Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FIX: deprecate qt4/5 rcparams#10351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletionslib/matplotlib/rcsetup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -267,27 +267,26 @@ def validate_backend(s):


def validate_qt4(s):
# Don't spam the test suite with warnings every time the rcparams are
# reset. While it may seem better to use filterwarnings from within the
# test suite, pytest 3.1+ explicitly disregards warnings filters (pytest
# issue #2430).
if not testing.is_called_from_pytest():
cbook.warn_deprecated(
"2.2",
"The backend.qt4 rcParam was deprecated in version 2.2. In order "
"to force the use of a specific Qt4 binding, either import that "
"binding first, or set the QT_API environment variable.")
if s is None:
# return a reasonable default for deprecation period
return 'PyQt4'
cbook.warn_deprecated(
"2.2",
"The backend.qt4 rcParam was deprecated in version 2.2. In order "
"to force the use of a specific Qt4 binding, either import that "
"binding first, or set the QT_API environment variable.")
return ValidateInStrings("backend.qt4", ['PyQt4', 'PySide', 'PyQt4v2'])(s)


def validate_qt5(s):
# See comment re: validate_qt4.
if not testing.is_called_from_pytest():
cbook.warn_deprecated(
"2.2",
"The backend.qt5 rcParam was deprecated in version 2.2. In order "
"to force the use of a specific Qt5 binding, either import that "
"binding first, or set the QT_API environment variable.")
if s is None:
# return a reasonable default for deprecation period
return 'PyQt5'
cbook.warn_deprecated(
"2.2",
"The backend.qt5 rcParam was deprecated in version 2.2. In order "
"to force the use of a specific Qt5 binding, either import that "
"binding first, or set the QT_API environment variable.")
return ValidateInStrings("backend.qt5", ['PyQt5', 'PySide2'])(s)


Expand DownExpand Up@@ -958,8 +957,8 @@ def _validate_linestyle(ls):
'backend': ['Agg', validate_backend], # agg is certainly
# present
'backend_fallback': [True, validate_bool], # agg is certainly present
'backend.qt4': ['PyQt4', validate_qt4],
'backend.qt5': ['PyQt5', validate_qt5],
'backend.qt4': [None, validate_qt4],
'backend.qt5': [None, validate_qt5],
'webagg.port': [8988, validate_int],
'webagg.address': ['127.0.0.1', validate_webagg_address],
'webagg.open_in_browser': [True, validate_bool],
Expand Down
5 changes: 0 additions & 5 deletionsmatplotlibrc.template
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,11 +40,6 @@
# non-interactive backend.
backend : $TEMPLATE_BACKEND

# If you are using the Qt4Agg backend, you can choose here
# to use the PyQt4 bindings or the newer PySide bindings to
# the underlying Qt4 toolkit.
#backend.qt4 : PyQt4 # PyQt4 | PySide

# Note that this can be overridden by the environment variable
# QT_API used by Enthought Tool Suite (ETS); valid values are
# "pyqt" and "pyside". The "pyqt" setting has the side effect of
Expand Down
9 changes: 2 additions & 7 deletionstutorials/introductory/usage.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -495,13 +495,8 @@ def my_plotter(ax, data1, data2, param_dict):
# How do I select PyQt4 or PySide?
# --------------------------------
#
# You can choose either PyQt4 or PySide when using the `qt4` backend by setting
# the appropriate value for `backend.qt4` in your :file:`matplotlibrc` file. The
# default value is `PyQt4`.
#
# The setting in your :file:`matplotlibrc` file can be overridden by setting the
# `QT_API` environment variable to either `pyqt` or `pyside` to use `PyQt4` or
# `PySide`, respectively.
# The `QT_API` environment variable can be set to either `pyqt` or `pyside`
# to use `PyQt4` or `PySide`, respectively.
#
# Since the default value for the bindings to be used is `PyQt4`,
# :mod:`matplotlib` first tries to import it, if the import fails, it tries to
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp