|
1 | | -from matplotlib.backends.qt_compat import QtWidgets |
| 1 | +from matplotlib import cbook |
| 2 | +from ._formsubplottool import UiSubplotTool |
2 | 3 |
|
3 | 4 |
|
4 | | -class UiSubplotTool(QtWidgets.QDialog): |
5 | | - |
6 | | - def __init__(self, *args, **kwargs): |
7 | | - super().__init__(*args, **kwargs) |
8 | | - self.setObjectName("SubplotTool") |
9 | | - self._widgets = {} |
10 | | - |
11 | | - layout = QtWidgets.QHBoxLayout() |
12 | | - self.setLayout(layout) |
13 | | - |
14 | | - left = QtWidgets.QVBoxLayout() |
15 | | - layout.addLayout(left) |
16 | | - right = QtWidgets.QVBoxLayout() |
17 | | - layout.addLayout(right) |
18 | | - |
19 | | - box = QtWidgets.QGroupBox("Borders") |
20 | | - left.addWidget(box) |
21 | | - inner = QtWidgets.QFormLayout(box) |
22 | | - for side in ["top", "bottom", "left", "right"]: |
23 | | - self._widgets[side] = widget = QtWidgets.QDoubleSpinBox() |
24 | | - widget.setMinimum(0) |
25 | | - widget.setMaximum(1) |
26 | | - widget.setDecimals(3) |
27 | | - widget.setSingleStep(.005) |
28 | | - widget.setKeyboardTracking(False) |
29 | | - inner.addRow(side, widget) |
30 | | - left.addStretch(1) |
31 | | - |
32 | | - box = QtWidgets.QGroupBox("Spacings") |
33 | | - right.addWidget(box) |
34 | | - inner = QtWidgets.QFormLayout(box) |
35 | | - for side in ["hspace", "wspace"]: |
36 | | - self._widgets[side] = widget = QtWidgets.QDoubleSpinBox() |
37 | | - widget.setMinimum(0) |
38 | | - widget.setMaximum(1) |
39 | | - widget.setDecimals(3) |
40 | | - widget.setSingleStep(.005) |
41 | | - widget.setKeyboardTracking(False) |
42 | | - inner.addRow(side, widget) |
43 | | - right.addStretch(1) |
44 | | - |
45 | | - widget = QtWidgets.QPushButton("Export values") |
46 | | - self._widgets["Export values"] = widget |
47 | | - # Don't trigger on <enter>, which is used to input values. |
48 | | - widget.setAutoDefault(False) |
49 | | - left.addWidget(widget) |
50 | | - |
51 | | - for action in ["Tight layout", "Reset", "Close"]: |
52 | | - self._widgets[action] = widget = QtWidgets.QPushButton(action) |
53 | | - widget.setAutoDefault(False) |
54 | | - right.addWidget(widget) |
55 | | - |
56 | | - self._widgets["Close"].setFocus() |
| 5 | +cbook.warn_deprecated( |
| 6 | + "3.3", obj_type="module", name=__name__, |
| 7 | + alternative="matplotlib.backends.backend_qt5.SubplotToolQt") |
| 8 | +__all__ = ["UiSubplotTool"] |
0 commit comments