Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3bf56aa

Browse files
authored
Merge pull request #19894 from QuLogic/remove-qt4
API: Remove deprecated Qt4 backends
2 parents 6cf9219 + e410271 commit 3bf56aa

File tree

21 files changed

+71
-259
lines changed

21 files changed

+71
-259
lines changed

doc/api/backend_qt_api.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ to building the docs.
66
.. redirect-from:: /api/backend_qt5agg_api
77
.. redirect-from:: /api/backend_qt5cairo_api
88

9-
:mod:`matplotlib.backends.backend_qt4agg`
10-
=========================================
11-
12-
.. module:: matplotlib.backends.backend_qt4agg
13-
14-
:mod:`matplotlib.backends.backend_qt4cairo`
15-
===========================================
16-
17-
.. module:: matplotlib.backends.backend_qt4cairo
18-
199
:mod:`matplotlib.backends.backend_qt5agg`
2010
=========================================
2111

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Qt4-based backends
2+
~~~~~~~~~~~~~~~~~~
3+
The qt4agg and qt4cairo backends have been removed. Qt4 has reached its
4+
end-of-life in 2015 and there are no releases of either PyQt4 or PySide for
5+
recent versions of Python. Please use one of the Qt5 or Qt6 backends.
6+
7+
``qt_compat.is_pyqt5``
8+
~~~~~~~~~~~~~~~~~~~~~~
9+
This function has been removed due to the release of PyQt6. The Qt version can
10+
be checked using ``QtCore.qVersion()``.
11+
12+
``matplotlib.backends.qt_editor.formsubplottool``
13+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14+
This module has been removed. Use
15+
``matplotlib.backends.backend_qt5.SubplotToolQt`` instead.

doc/api/prev_api_changes/api_changes_3.3.0/deprecations.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ accepted.
609609
Qt modifier keys
610610
~~~~~~~~~~~~~~~~
611611
The ``MODIFIER_KEYS``, ``SUPER``, ``ALT``, ``CTRL``, and ``SHIFT``
612-
global variables of the :mod:`matplotlib.backends.backend_qt4agg`,
613-
:mod:`matplotlib.backends.backend_qt4cairo`,
612+
global variables of the ``matplotlib.backends.backend_qt4agg``,
613+
``matplotlib.backends.backend_qt4cairo``,
614614
:mod:`matplotlib.backends.backend_qt5agg` and
615615
:mod:`matplotlib.backends.backend_qt5cairo` modules are deprecated.
616616

doc/devel/dependencies.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Matplotlib figures can be rendered to various user interfaces. See
4040
and the capabilities they provide.
4141

4242
* Tk_ (>= 8.3, != 8.6.0 or 8.6.1) [#]_: for the Tk-based backends.
43-
* PyQt4_ (>= 4.6) or PySide_ (>= 1.0.3) [#]_: for the Qt4-based backends.
4443
* PyQt5_ or PySide2_: for the Qt5-based backends.
4544
* PyGObject_: for the GTK3-based backends [#]_.
4645
* wxPython_ (>= 4) [#]_: for the wx-based backends.
@@ -49,8 +48,6 @@ and the capabilities they provide.
4948
* Tornado_: for the WebAgg backend.
5049

5150
.. _Tk: https://docs.python.org/3/library/tk.html
52-
.. _PyQt4: https://pypi.org/project/PyQt4
53-
.. _PySide: https://pypi.org/project/PySide
5451
.. _PyQt5: https://pypi.org/project/PyQt5
5552
.. _PySide2: https://pypi.org/project/PySide2
5653
.. _PyGObject: https://pygobject.readthedocs.io/en/latest/

examples/user_interfaces/embedding_in_qt_sgskip.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@
1515
import numpy as np
1616

1717
from matplotlib.backends.qt_compat import QtCore, QtWidgets
18-
if QtCore.qVersion() >= "5.":
19-
from matplotlib.backends.backend_qt5agg import (
20-
FigureCanvas, NavigationToolbar2QT as NavigationToolbar)
21-
else:
22-
from matplotlib.backends.backend_qt4agg import (
23-
FigureCanvas, NavigationToolbar2QT as NavigationToolbar)
18+
from matplotlib.backends.backend_qt5agg import (
19+
FigureCanvas, NavigationToolbar2QT as NavigationToolbar)
2420
from matplotlib.figure import Figure
2521

2622

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ def use(backend, *, force=True):
10661066
10671067
- interactive backends:
10681068
GTK3Agg, GTK3Cairo, MacOSX, nbAgg,
1069-
Qt4Agg, Qt4Cairo, Qt5Agg, Qt5Cairo,
1069+
Qt5Agg, Qt5Cairo,
10701070
TkAgg, TkCairo, WebAgg, WX, WXAgg, WXCairo
10711071
10721072
- non-interactive backends:

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ def _safe_pyplot_import():
9999
if current_framework is None:
100100
raise # No, something else went wrong, likely with the install...
101101
backend_mapping = {'qt5': 'qt5agg',
102-
'qt4': 'qt4agg',
103102
'gtk3': 'gtk3agg',
104103
'wx': 'wxagg',
105104
'tk': 'tkagg',
@@ -1680,7 +1679,7 @@ class FigureCanvasBase:
16801679
A high-level figure instance.
16811680
"""
16821681

1683-
# Set to one of {"qt5", "qt4", "gtk3", "wx", "tk", "macosx"} if an
1682+
# Set to one of {"qt5", "gtk3", "wx", "tk", "macosx"} if an
16841683
# interactive framework is required, or None otherwise.
16851684
required_interactive_framework = None
16861685

@@ -1756,7 +1755,7 @@ def _fix_ipython_backend2gui(cls):
17561755
# don't break on our side.
17571756
return
17581757
rif = getattr(cls, "required_interactive_framework", None)
1759-
backend2gui_rif = {"qt5": "qt", "qt4": "qt", "gtk3": "gtk3",
1758+
backend2gui_rif = {"qt5": "qt", "gtk3": "gtk3",
17601759
"wx": "wx", "macosx": "osx"}.get(rif)
17611760
if backend2gui_rif:
17621761
if _is_non_interactive_terminal_ipython(ip):

lib/matplotlib/backends/backend_qt4.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

lib/matplotlib/backends/backend_qt4agg.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

lib/matplotlib/backends/backend_qt4cairo.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)