Changeset 4992ff2 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.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/Perspectives/Fitting/FittingWidget.py
r7fb471d r4992ff2 9 9 import numpy as np 10 10 11 from PyQt4 import QtGui 12 from PyQt4 import QtCore 13 from PyQt4 import QtWebKit 11 from PyQt5 import QtCore 12 from PyQt5 import QtGui 13 from PyQt5 import QtWidgets 14 from PyQt5 import QtWebKitWidgets 14 15 15 16 from sasmodels import product … … 74 75 return QtGui.QStandardItemModel.headerData(self, section, orientation, role) 75 76 76 class FittingWidget(Qt Gui.QWidget, Ui_FittingWidgetUI):77 class FittingWidget(QtWidgets.QWidget, Ui_FittingWidgetUI): 77 78 """ 78 79 Main widget for selecting form and structure factor models … … 121 122 122 123 # Display HTML content 123 self.helpView = QtWebKit .QWebView()124 self.helpView = QtWebKitWidgets.QWebView() 124 125 125 126 # New font to display angstrom symbol … … 233 234 """ 234 235 # Options widget 235 layout = Qt Gui.QGridLayout()236 layout = QtWidgets.QGridLayout() 236 237 self.options_widget = OptionsWidget(self, self.logic) 237 238 layout.addWidget(self.options_widget) … … 239 240 240 241 # Smearing widget 241 layout = Qt Gui.QGridLayout()242 layout = QtWidgets.QGridLayout() 242 243 self.smearing_widget = SmearingWidget(self) 243 244 layout.addWidget(self.smearing_widget) … … 254 255 255 256 # Magnetic angles explained in one picture 256 self.magneticAnglesWidget = Qt Gui.QWidget()257 labl = Qt Gui.QLabel(self.magneticAnglesWidget)257 self.magneticAnglesWidget = QtWidgets.QWidget() 258 labl = QtWidgets.QLabel(self.magneticAnglesWidget) 258 259 pixmap = QtGui.QPixmap(GuiUtils.IMAGES_DIRECTORY_LOCATION + '/M_angles_pic.bmp') 259 260 labl.setPixmap(pixmap) … … 274 275 self.lstParams.setModel(self._model_model) 275 276 self.readCategoryInfo() 277 276 278 self.model_parameters = None 277 279 … … 307 309 self.lstParams.customContextMenuRequested.connect(self.showModelDescription) 308 310 self.lstParams.setAttribute(QtCore.Qt.WA_MacShowFocusRect, False) 309 310 311 # Poly model displayed in poly list 311 312 self.lstPoly.setModel(self._poly_model) … … 466 467 msg += "You must select a model to get information on this" 467 468 468 menu = Qt Gui.QMenu()469 label = Qt Gui.QLabel(msg)469 menu = QtWidgets.QMenu() 470 label = QtWidgets.QLabel(msg) 470 471 action = QtGui.QWidgetAction(self) 471 472 action.setDefaultWidget(label) … … 915 916 self.lstParams.resizeColumnToContents(4) 916 917 self.lstParams.resizeColumnToContents(5) 917 self.lstParams.setSizePolicy(Qt Gui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)918 self.lstParams.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding) 918 919 919 920 self.has_error_column = True … … 1230 1231 # Adjust the table cells width 1231 1232 self.lstParams.resizeColumnToContents(0) 1232 self.lstParams.setSizePolicy(Qt Gui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)1233 self.lstParams.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding) 1233 1234 1234 1235 # Now we claim the model has been loaded … … 1536 1537 table.verticalHeader().setVisible(False) 1537 1538 table.setAlternatingRowColors(True) 1538 table.setSizePolicy(Qt Gui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)1539 table.setSelectionBehavior(Qt Gui.QAbstractItemView.SelectRows)1539 table.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding) 1540 table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) 1540 1541 table.resizeColumnsToContents() 1541 1542 1542 1543 # Header 1543 1544 header = table.horizontalHeader() 1544 header.setResizeMode(QtGui.QHeaderView.ResizeToContents) 1545 1546 header.ResizeMode(QtGui.QHeaderView.Interactive) 1545 header.setSectionResizeMode(QtWidgets.QHeaderView.ResizeToContents) 1546 header.ResizeMode(QtWidgets.QHeaderView.Interactive) 1547 1548 # Qt5: the following 2 lines crash - figure out why! 1547 1549 # Resize column 0 and 7 to content 1548 header.setResizeMode(0, QtGui.QHeaderView.ResizeToContents)1549 header.setResizeMode(7, QtGui.QHeaderView.ResizeToContents)1550 #header.setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeToContents) 1551 #header.setSectionResizeMode(7, QtWidgets.QHeaderView.ResizeToContents) 1550 1552 1551 1553 def setPolyModel(self): … … 1600 1602 1601 1603 # All possible polydisp. functions as strings in combobox 1602 func = Qt Gui.QComboBox()1604 func = QtWidgets.QComboBox() 1603 1605 func.addItems([str(name_disp) for name_disp in POLYDISPERSITY_MODELS.keys()]) 1604 1606 # Set the default index … … 1683 1685 Show the load file dialog and loads requested data into state 1684 1686 """ 1685 datafile = Qt Gui.QFileDialog.getOpenFileName(1686 self, "Choose a weight file", "", "All files (*.*)", 1687 Qt Gui.QFileDialog.DontUseNativeDialog)1687 datafile = QtWidgets.QFileDialog.getOpenFileName( 1688 self, "Choose a weight file", "", "All files (*.*)", None, 1689 QtWidgets.QFileDialog.DontUseNativeDialog) 1688 1690 1689 1691 if datafile is None or str(datafile)=='': … … 1784 1786 item1 = QtGui.QStandardItem(param_name) 1785 1787 1786 func = Qt Gui.QComboBox()1788 func = QtWidgets.QComboBox() 1787 1789 # Available range of shells displayed in the combobox 1788 1790 func.addItems([str(i) for i in range(param_length+1)])
Note: See TracChangeset
for help on using the changeset viewer.