diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 32e476cacc5a..f7deba2db322 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -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) @@ -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], diff --git a/matplotlibrc.template b/matplotlibrc.template index 7ac32f71cf8d..671a450080a1 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -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 diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index 05cb65664712..185f38d29b65 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -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
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: