Changeset 4992ff2 in sasview for src/sas/qtgui/Calculators
- Timestamp:
- Nov 9, 2017 8:43:07 AM (7 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 07:50:09)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:43:07)
- Location:
- src/sas/qtgui/Calculators
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Calculators/DataOperationUtilityPanel.py
r7fb471d r4992ff2 4 4 import copy 5 5 6 from PyQt4 import QtGui 7 from PyQt4 import QtCore 6 from PyQt5 import QtCore 7 from PyQt5 import QtGui 8 from PyQt5 import QtWidgets 8 9 9 10 from sas.qtgui.Plotting.PlotterData import Data1D … … 19 20 20 21 21 class DataOperationUtilityPanel(Qt Gui.QDialog, Ui_DataOperationUtility):22 class DataOperationUtilityPanel(QtWidgets.QDialog, Ui_DataOperationUtility): 22 23 def __init__(self, parent=None): 23 24 super(DataOperationUtilityPanel, self).__init__() … … 57 58 self.txtNumber.setValidator(QtGui.QDoubleValidator()) 58 59 59 self.layoutOutput = Qt Gui.QHBoxLayout()60 self.layoutData1 = Qt Gui.QHBoxLayout()61 self.layoutData2 = Qt Gui.QHBoxLayout()60 self.layoutOutput = QtWidgets.QHBoxLayout() 61 self.layoutData1 = QtWidgets.QHBoxLayout() 62 self.layoutData2 = QtWidgets.QHBoxLayout() 62 63 63 64 # Create default layout for initial graphs (when they are still empty) … … 383 384 def newPlot(self, graph, layout): 384 385 """ Create template for graphs with default '?' layout""" 385 assert isinstance(graph, Qt Gui.QGraphicsView)386 assert isinstance(layout, Qt Gui.QHBoxLayout)386 assert isinstance(graph, QtWidgets.QGraphicsView) 387 assert isinstance(layout, QtWidgets.QHBoxLayout) 387 388 388 389 # clear layout … … 399 400 """ plot data in graph after clearing its layout """ 400 401 401 assert isinstance(graph, Qt Gui.QGraphicsView)402 assert isinstance(layout, Qt Gui.QHBoxLayout)402 assert isinstance(graph, QtWidgets.QGraphicsView) 403 assert isinstance(layout, QtWidgets.QHBoxLayout) 403 404 404 405 # clear layout … … 455 456 def prepareSubgraphWithData(self, data): 456 457 """ Create graphics view containing scene with string """ 457 scene = Qt Gui.QGraphicsScene()458 scene = QtWidgets.QGraphicsScene() 458 459 scene.addText(str(data)) 459 460 460 subgraph = Qt Gui.QGraphicsView()461 subgraph = QtWidgets.QGraphicsView() 461 462 subgraph.setScene(scene) 462 463 -
src/sas/qtgui/Calculators/DensityPanel.py
- Property mode changed from 100755 to 100644
rb3e8629 r4992ff2 2 2 import logging 3 3 import functools 4 from PyQt4 import QtGui, QtCore 4 from PyQt5 import QtCore 5 from PyQt5 import QtGui 6 from PyQt5 import QtWidgets 5 7 6 8 from periodictable import formula as Formula … … 39 41 40 42 41 class DensityPanel(Qt Gui.QDialog):43 class DensityPanel(QtWidgets.QDialog): 42 44 43 45 def __init__(self, parent=None): … … 68 70 self.ui.editMassDensity.textEdited.connect(functools.partial(self.setMode, MODES.DENSITY_TO_VOLUME)) 69 71 70 self.ui.buttonBox.button(Qt Gui.QDialogButtonBox.Reset).clicked.connect(self.modelReset)71 self.ui.buttonBox.button(Qt Gui.QDialogButtonBox.Help).clicked.connect(self.displayHelp)72 self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Reset).clicked.connect(self.modelReset) 73 self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Help).clicked.connect(self.displayHelp) 72 74 73 75 def setupModel(self): … … 83 85 84 86 def setupMapper(self): 85 self.mapper = Qt Gui.QDataWidgetMapper(self)87 self.mapper = QtWidgets.QDataWidgetMapper(self) 86 88 self.mapper.setModel(self.model) 87 89 self.mapper.setOrientation(QtCore.Qt.Vertical) … … 92 94 self.mapper.addMapping(self.ui.editMassDensity , MODEL.MASS_DENSITY) 93 95 94 self.mapper.toFirst() 96 # FIXME DOESNT WORK WITH QT5 97 #self.mapper.toFirst() 95 98 96 99 def dataChanged(self, top, bottom): -
src/sas/qtgui/Calculators/GenericScatteringCalculator.py
r7fb471d r4992ff2 5 5 import time 6 6 7 from PyQt4 import QtGui 8 from PyQt4 import QtCore 7 from PyQt5 import QtCore 8 from PyQt5 import QtGui 9 from PyQt5 import QtWidgets 10 9 11 from twisted.internet import threads 10 12 … … 27 29 28 30 29 class GenericScatteringCalculator(Qt Gui.QDialog, Ui_GenericScatteringCalculator):31 class GenericScatteringCalculator(QtWidgets.QDialog, Ui_GenericScatteringCalculator): 30 32 31 33 trigger_plot_3d = QtCore.pyqtSignal() … … 129 131 """ 130 132 try: 131 self.datafile = Qt Gui.QFileDialog.getOpenFileName(133 self.datafile = QtWidgets.QFileDialog.getOpenFileName( 132 134 self, "Choose a file", "", "All Gen files (*.OMF *.omf) ;;" 133 135 "SLD files (*.SLD *.sld);;PDB files (*.pdb *.PDB);; " … … 607 609 'directory': default_name, 608 610 'filter': 'SLD file (*.sld)', 609 'options': Qt Gui.QFileDialog.DontUseNativeDialog}611 'options': QtWidgets.QFileDialog.DontUseNativeDialog} 610 612 # Query user for filename. 611 filename = str(Qt Gui.QFileDialog.getSaveFileName(**kwargs))613 filename = str(QtWidgets.QFileDialog.getSaveFileName(**kwargs)) 612 614 if filename: 613 615 try: … … 830 832 831 833 832 class Plotter3D(Qt Gui.QDialog, Plotter3DWidget):834 class Plotter3D(QtWidgets.QDialog, Plotter3DWidget): 833 835 def __init__(self, parent=None, graph_title=''): 834 836 self.graph_title = graph_title 835 Qt Gui.QDialog.__init__(self)837 QtWidgets.QDialog.__init__(self) 836 838 Plotter3DWidget.__init__(self, manager=parent) 837 839 self.setWindowTitle(self.graph_title) -
src/sas/qtgui/Calculators/KiessigPanel.py
- Property mode changed from 100755 to 100644
rb3e8629 r4992ff2 1 from PyQt4 import QtGui 2 from PyQt4 import QtCore 1 from PyQt5 import QtCore 2 from PyQt5 import QtGui 3 from PyQt5 import QtWidgets 3 4 4 5 from sas.qtgui.UI import main_resources_rc … … 10 11 11 12 12 class KiessigPanel(Qt Gui.QDialog, Ui_KiessigPanel):13 class KiessigPanel(QtWidgets.QDialog, Ui_KiessigPanel): 13 14 def __init__(self, parent=None): 14 15 super(KiessigPanel, self).__init__() -
src/sas/qtgui/Calculators/ResolutionCalculatorPanel.py
r7fb471d r4992ff2 4 4 instrumental parameters. 5 5 """ 6 from PyQt4 import QtGui 7 from PyQt4 import QtCore 6 from PyQt5 import QtCore 7 from PyQt5 import QtGui 8 from PyQt5 import QtWidgets 8 9 9 10 from twisted.internet import threads … … 33 34 34 35 35 class ResolutionCalculatorPanel(Qt Gui.QDialog, Ui_ResolutionCalculatorPanel):36 class ResolutionCalculatorPanel(QtWidgets.QDialog, Ui_ResolutionCalculatorPanel): 36 37 """ 37 38 compute resolution in 2D … … 315 316 """ On Spectrum Combobox event""" 316 317 if self.cbCustomSpectrum.currentText() == 'Add New': 317 datafile = Qt Gui.QFileDialog.getOpenFileName(318 datafile = QtWidgets.QFileDialog.getOpenFileName( 318 319 self, "Choose a spectral distribution file", "", 319 320 "All files (*.*)", 320 Qt Gui.QFileDialog.DontUseNativeDialog)321 QtWidgets.QFileDialog.DontUseNativeDialog) 321 322 322 323 if datafile is None or str(datafile) == '': … … 721 722 self.plotter.scale = 'linear' 722 723 self.plotter.cmap = None 723 layout = Qt Gui.QHBoxLayout()724 layout = QtWidgets.QHBoxLayout() 724 725 layout.setContentsMargins(0, 0, 0, 0) 725 726 self.graphicsView.setLayout(layout) -
src/sas/qtgui/Calculators/SldPanel.py
r7fb471d r4992ff2 1 1 # global 2 2 import logging 3 from PyQt4 import QtGui, QtCore 3 from PyQt5 import QtCore 4 from PyQt5 import QtGui 5 from PyQt5 import QtWidgets 4 6 5 7 from periodictable import formula as Formula … … 97 99 98 100 99 class SldPanel(Qt Gui.QDialog):101 class SldPanel(QtWidgets.QDialog): 100 102 101 103 def __init__(self, parent=None): … … 133 135 134 136 # signals 135 self.ui.buttonBox.button(Qt Gui.QDialogButtonBox.Reset).clicked.connect(self.modelReset)136 self.ui.buttonBox.button(Qt Gui.QDialogButtonBox.Help).clicked.connect(self.displayHelp)137 self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Reset).clicked.connect(self.modelReset) 138 self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Help).clicked.connect(self.displayHelp) 137 139 138 140 def setupModel(self): … … 145 147 self.model.setItem(key, QtGui.QStandardItem()) 146 148 147 QtCore.QObject.connect( 148 self.model, 149 QtCore.SIGNAL("dataChanged(QModelIndex,QModelIndex)"), 150 self.dataChanged) 149 self.model.dataChanged.connect(self.dataChanged) 150 #QtCore.QObject.connect( 151 # self.model, 152 # QtCore.SIGNAL("dataChanged(QModelIndex,QModelIndex)"), 153 # self.dataChanged) 151 154 152 155 self.modelReset() 153 156 154 157 def setupMapper(self): 155 self.mapper = Qt Gui.QDataWidgetMapper(self)158 self.mapper = QtWidgets.QDataWidgetMapper(self) 156 159 self.mapper.setModel(self.model) 157 160 self.mapper.setOrientation(QtCore.Qt.Vertical) 158 159 161 self.mapper.addMapping(self.ui.editMolecularFormula, MODEL.MOLECULAR_FORMULA) 160 162 self.mapper.addMapping(self.ui.editMassDensity , MODEL.MASS_DENSITY) … … 164 166 self.mapper.addMapping(edit, key) 165 167 166 self.mapper.toFirst() 168 # FIXME DOESNT WORK WITH QT5 169 #self.mapper.toFirst() 167 170 168 171 def dataChanged(self, top, bottom): -
src/sas/qtgui/Calculators/SlitSizeCalculator.py
r7fb471d r4992ff2 5 5 import sys 6 6 7 from PyQt4 import QtGui 8 from PyQt4 import QtCore 7 from PyQt5 import QtCore 8 from PyQt5 import QtGui 9 from PyQt5 import QtWidgets 9 10 10 11 from sas.qtgui.UI import main_resources_rc … … 16 17 17 18 18 class SlitSizeCalculator(Qt Gui.QDialog, Ui_SlitSizeCalculator):19 class SlitSizeCalculator(QtWidgets.QDialog, Ui_SlitSizeCalculator): 19 20 """ 20 21 Provides the slit length calculator GUI. … … 75 76 # Location is automatically saved - no need to keep track of the last dir 76 77 # But only with Qt built-in dialog (non-platform native) 77 path = Qt Gui.QFileDialog.getOpenFileName(self, "Choose a file", "",78 path = QtWidgets.QFileDialog.getOpenFileName(self, "Choose a file", "", 78 79 "SAXSess 1D data (*.txt *.TXT *.dat *.DAT)", 79 QtGui.QFileDialog.DontUseNativeDialog) 80 None, 81 QtWidgets.QFileDialog.DontUseNativeDialog) 80 82 81 83 if path is None:
Note: See TracChangeset
for help on using the changeset viewer.