From 1d8e52ef257edf9ebfebc20676fb5111d885e035 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 19 Mar 2019 10:41:49 +0100 Subject: [PATCH] Deprecate NavigationToolbar2QT.adj_window (unused and always None). All's in the changelog. --- doc/api/next_api_changes/2019-03-20-AL.rst | 5 +++++ lib/matplotlib/backends/backend_qt5.py | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 doc/api/next_api_changes/2019-03-20-AL.rst diff --git a/doc/api/next_api_changes/2019-03-20-AL.rst b/doc/api/next_api_changes/2019-03-20-AL.rst new file mode 100644 index 000000000000..5413b987bb89 --- /dev/null +++ b/doc/api/next_api_changes/2019-03-20-AL.rst @@ -0,0 +1,5 @@ +Deprecations +```````````` + +The (unused and always None) ``NavigationToolbar2QT.adj_window`` attribute is +deprecated. diff --git a/lib/matplotlib/backends/backend_qt5.py b/lib/matplotlib/backends/backend_qt5.py index e9539c2fed08..7dc25faaff22 100644 --- a/lib/matplotlib/backends/backend_qt5.py +++ b/lib/matplotlib/backends/backend_qt5.py @@ -724,9 +724,6 @@ def _init_toolbar(self): labelAction = self.addWidget(self.locLabel) labelAction.setVisible(True) - # reference holder for subplots_adjust window - self.adj_window = None - # Esthetic adjustments - we need to set these explicitly in PyQt5 # otherwise the layout looks different - but we don't want to set it if # not using HiDPI icons otherwise they look worse than before. @@ -739,6 +736,11 @@ def _init_toolbar(self): def buttons(self): return {} + @cbook.deprecated("3.1") + @property + def adj_window(self): + return None + if is_pyqt5(): # For some reason, self.setMinimumHeight doesn't seem to carry over to # the actual sizeHint, so override it instead in order to make the