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

Skip to content

Commit cd6511b

Browse files
committed
Leave export values as modal
1 parent 643c336 commit cd6511b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,14 +802,13 @@ def __init__(self, targetfig, parent):
802802
self._figure = targetfig
803803
self._defaults = {spinbox: vars(self._figure.subplotpars)[attr]
804804
for attr, spinbox in self._spinboxes.items()}
805-
self._export_values_dialog = None
806805

807806
def _export_values(self):
808807
# Explicitly round to 3 decimals (which is also the spinbox precision)
809808
# to avoid numbers of the form 0.100...001.
810-
self._export_values_dialog = QtWidgets.QDialog()
809+
dialog = QtWidgets.QDialog()
811810
layout = QtWidgets.QVBoxLayout()
812-
self._export_values_dialog.setLayout(layout)
811+
dialog.setLayout(layout)
813812
text = QtWidgets.QPlainTextEdit()
814813
text.setReadOnly(True)
815814
layout.addWidget(text)
@@ -823,7 +822,7 @@ def _export_values(self):
823822
QtGui.QFontMetrics(text.document().defaultFont())
824823
.size(0, text.toPlainText()).height() + 20)
825824
text.setMaximumSize(size)
826-
self._export_values_dialog.show()
825+
dialog.exec_()
827826

828827
def _on_value_changed(self):
829828
spinboxes = self._spinboxes

0 commit comments

Comments
 (0)