diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index 7e70a16e68c7..88b1e8e7c17f 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -116,6 +116,9 @@ original location: * The ``fmt`` argument of :meth:`~matplotlib.axes.Axes.plot_date` has been changed from ``bo`` to just ``o``, so color cycling can happen by default. +* Removed the class `FigureManagerQTAgg` and deprecated `NavigationToolbar2QTAgg` + which will be removed in 1.5. + .. _changes_in_1_3: diff --git a/examples/user_interfaces/embedding_in_qt4_wtoolbar.py b/examples/user_interfaces/embedding_in_qt4_wtoolbar.py index c8688bd7cefe..b087e9d73dfd 100644 --- a/examples/user_interfaces/embedding_in_qt4_wtoolbar.py +++ b/examples/user_interfaces/embedding_in_qt4_wtoolbar.py @@ -7,7 +7,7 @@ from matplotlib.backend_bases import key_press_handler from matplotlib.backends.backend_qt4agg import ( FigureCanvasQTAgg as FigureCanvas, - NavigationToolbar2QTAgg as NavigationToolbar) + NavigationToolbar2QT as NavigationToolbar) from matplotlib.backends import qt4_compat use_pyside = qt4_compat.QT_API == qt4_compat.QT_API_PYSIDE diff --git a/lib/matplotlib/backends/backend_qt4agg.py b/lib/matplotlib/backends/backend_qt4agg.py index 5a6c74d1985c..ce6a06016e14 100644 --- a/lib/matplotlib/backends/backend_qt4agg.py +++ b/lib/matplotlib/backends/backend_qt4agg.py @@ -9,6 +9,7 @@ import os # not used import sys import ctypes +import warnings import matplotlib from matplotlib.figure import Figure @@ -24,6 +25,7 @@ from .backend_qt4 import draw_if_interactive from .backend_qt4 import backend_version ###### +from matplotlib.cbook import mplDeprecation DEBUG = False @@ -168,5 +170,15 @@ def print_figure(self, *args, **kwargs): self.draw() +class NavigationToolbar2QTAgg(NavigationToolbar2QT): + def __init__(*args, **kwargs): + warnings.warn('This class has been deprecated in 1.4 ' + + 'as it has no additional functionality over ' + + '`NavigationToolbar2QT`. Please change your code to ' + 'use `NavigationToolbar2QT` instead', + mplDeprecation) + NavigationToolbar2QT.__init__(*args, **kwargs) + + FigureCanvas = FigureCanvasQTAgg FigureManager = FigureManagerQT