Changeset 4992ff2 in sasview for src/sas/qtgui/Plotting/PlotterBase.py
- Timestamp:
- Nov 9, 2017 6:43:07 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 7969b9c
- Parents:
- 7fb471d
- git-author:
- Piotr Rozyczko <rozyczko@…> (10/30/17 05:50:09)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 06:43:07)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/PlotterBase.py
r7d8bebf r4992ff2 2 2 import numpy 3 3 4 from PyQt4 import QtGui 5 from PyQt4 import QtCore 4 from PyQt5 import QtCore 5 from PyQt5 import QtGui 6 from PyQt5 import QtWidgets 6 7 7 8 # TODO: Replace the qt4agg calls below with qt5 equivalent. … … 9 10 # https://www.boxcontrol.net/embedding-matplotlib-plot-on-pyqt5-gui.html 10 11 # 11 from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas 12 from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar 12 # matplotlib.use("Qt5Agg") 13 from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas 14 from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar 13 15 14 16 import matplotlib.pyplot as plt … … 25 27 import sas.qtgui.Plotting.PlotUtilities as PlotUtilities 26 28 27 class PlotterBase(Qt Gui.QWidget):29 class PlotterBase(QtWidgets.QWidget): 28 30 def __init__(self, parent=None, manager=None, quickplot=False): 29 31 super(PlotterBase, self).__init__(parent) … … 43 45 44 46 # Simple window for data display 45 self.txt_widget = Qt Gui.QTextEdit(None)47 self.txt_widget = QtWidgets.QTextEdit(None) 46 48 47 49 # Set the layout and place the canvas widget in it. 48 layout = QtGui.QVBoxLayout() 49 layout.setMargin(0) 50 layout = QtWidgets.QVBoxLayout() 51 # FIXME setMargin -> setContentsMargins in qt5 with 4 args 52 #layout.setContentsMargins(0) 50 53 layout.addWidget(self.canvas) 51 54 … … 105 108 self.canvas.mpl_connect('scroll_event', self.onMplWheel) 106 109 107 self.contextMenu = Qt Gui.QMenu(self)110 self.contextMenu = QtWidgets.QMenu(self) 108 111 109 112 if not quickplot: … … 296 299 dialog.setModal(True) 297 300 dialog.setWindowTitle("Print") 298 if dialog.exec_() != Qt Gui.QDialog.Accepted:301 if dialog.exec_() != QtWidgets.QDialog.Accepted: 299 302 return 300 303 … … 303 306 pmap = QtGui.QPixmap.grabWidget(self) 304 307 # Create a label with pixmap drawn 305 printLabel = Qt Gui.QLabel()308 printLabel = QtWidgets.QLabel() 306 309 printLabel.setPixmap(pmap) 307 310 … … 333 336 titleWidget = WindowTitle(self, new_title=current_title) 334 337 result = titleWidget.exec_() 335 if result != Qt Gui.QDialog.Accepted:338 if result != QtWidgets.QDialog.Accepted: 336 339 return 337 340
Note: See TracChangeset
for help on using the changeset viewer.