Changeset 304d082 in sasview
- Timestamp:
- Oct 31, 2017 10:00:59 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:
- 6280464
- Parents:
- 0849aec
- Location:
- src/sas/qtgui
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
r0849aec r304d082 182 182 Opens the Qt "Open File..." dialog 183 183 """ 184 print("A")185 184 path_str = self.chooseFiles() 186 185 if not path_str: … … 193 192 Opens the Qt "Open Folder..." dialog 194 193 """ 195 folder = QtWidgets.QFileDialog.getExistingDirectory(self, "Choose a directory", "", None,194 folder = QtWidgets.QFileDialog.getExistingDirectory(self, "Choose a directory", "", 196 195 QtWidgets.QFileDialog.ShowDirsOnly | QtWidgets.QFileDialog.DontUseNativeDialog) 197 196 if folder is None: … … 398 397 if outer_item.isCheckable() and \ 399 398 outer_item.checkState() == QtCore.Qt.Checked: 399 self.model.beginResetModel() 400 400 theories_copied += 1 401 401 new_item = self.recursivelyCloneItem(outer_item) … … 405 405 new_item.setText(new_name) 406 406 self.model.appendRow(new_item) 407 self.model.reset() 407 self.model.endResetModel() 408 #self.model.reset() 408 409 409 410 freeze_msg = "" … … 577 578 578 579 # Add the plot to the workspace 579 self.parent.workspace().add Window(new_plot)580 self.parent.workspace().addSubWindow(new_plot) 580 581 581 582 # Show the plot … … 626 627 # But only with Qt built-in dialog (non-platform native) 627 628 paths = QtWidgets.QFileDialog.getOpenFileNames(self, "Choose a file", "", 628 wlist, None, QtWidgets.QFileDialog.DontUseNativeDialog) 629 wlist, None, QtWidgets.QFileDialog.DontUseNativeDialog)[0] 630 # [0] is new in Qt5 as getOpenFileNames() returns now a tuple! 629 631 if paths is None: 630 632 return … … 686 688 self.mutex.lock() 687 689 self.updateModel(new_data, p_file) 688 self.model.reset()689 Qt Gui.qApp.processEvents()690 #self.model.reset() 691 QtWidgets.QApplication.processEvents() 690 692 self.mutex.unlock() 691 693 … … 907 909 # Move the slider all the way up, if present 908 910 vertical_scroll_bar = self.txt_widget.verticalScrollBar() 909 vertical_scroll_bar.triggerAction(Qt Gui.QScrollBar.SliderToMinimum)911 vertical_scroll_bar.triggerAction(QtWidgets.QScrollBar.SliderToMinimum) 910 912 911 913 def saveDataAs(self): … … 995 997 996 998 # Reset the model so the view gets updated. 997 self.model.reset()999 #self.model.reset() 998 1000 self.communicator.progressBarUpdateSignal.emit(-1) 999 1001 … … 1005 1007 self.manager.add_data(data_list=output_data) 1006 1008 1007 def load Errback(self, reason):1009 def loadFailed(self, reason): 1008 1010 print("File Load Failed with:\n", reason) 1009 1011 pass … … 1047 1049 1048 1050 # New row in the model 1051 self.model.beginResetModel() 1049 1052 self.model.appendRow(checkbox_item) 1053 self.model.endResetModel() 1050 1054 1051 1055 def updateModelFromPerspective(self, model_item): … … 1062 1066 1063 1067 # Reset the view 1064 self.model.reset()1068 ##self.model.reset() 1065 1069 # Pass acting as a debugger anchor 1066 1070 pass … … 1098 1102 1099 1103 if __name__ == "__main__": 1100 app = Qt Gui.QApplication([])1104 app = QtWidgets.QApplication([]) 1101 1105 dlg = DataExplorerWindow() 1102 1106 dlg.show() -
src/sas/qtgui/MainWindow/GuiManager.py
r0849aec r304d082 77 77 78 78 # Invoke the initial perspective 79 self.perspectiveChanged("Fitting")79 #self.perspectiveChanged("Fitting") 80 80 self.addWidgets() 81 81 … … 91 91 # Set up the status bar 92 92 self.statusBarSetup() 93 94 93 # Show the Welcome panel 95 94 self.welcomePanel = WelcomePanel() … … 117 116 118 117 self.dockedFilesWidget = QDockWidget("Data Explorer", self._workspace) 119 self.dockedFilesWidget.setFloating( True)118 self.dockedFilesWidget.setFloating(False) 120 119 self.dockedFilesWidget.setWidget(self.filesWidget) 121 120 122 121 # Disable maximize/minimize and close buttons 123 122 self.dockedFilesWidget.setFeatures(QDockWidget.NoDockWidgetFeatures) 124 self.dockedFilesWidget.setFeatures(Qt.LeftDockWidgetArea) 125 126 self._workspace. workspace.addDockWidget(Qt.LeftDockWidgetArea, self.dockedFilesWidget)123 124 #self._workspace.workspace.addDockWidget(Qt.LeftDockWidgetArea, self.dockedFilesWidget) 125 self._workspace.addDockWidget(Qt.LeftDockWidgetArea, self.dockedFilesWidget) 127 126 128 127 # Add the console window as another docked widget … … 132 131 self.listWidget = QTextBrowser() 133 132 self.logDockWidget.setWidget(self.listWidget) 134 self._workspace. workspace.addDockWidget(Qt.BottomDockWidgetAre, self.logDockWidget)133 self._workspace.addDockWidget(Qt.BottomDockWidgetArea, self.logDockWidget) 135 134 136 135 # Add other, minor widgets … … 192 191 193 192 # Resize to the workspace height 194 workspace_height = self._workspace.workspace.sizeHint().height() 195 perspective_size = self._current_perspective.sizeHint() 196 if workspace_height < perspective_size.height(): 197 perspective_width = perspective_size.width() 198 self._current_perspective.resize(perspective_width, workspace_height-10) 193 #workspace_height = self._workspace.workspace.sizeHint().height() 194 #perspective_size = self._current_perspective.sizeHint() 195 #if workspace_height < perspective_size.height(): 196 # perspective_width = perspective_size.width() 197 # self._current_perspective.resize(perspective_width, workspace_height-10) 198 199 199 self._current_perspective.show() 200 200 -
src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py
r0849aec r304d082 48 48 self.initStyleOption(options,index) 49 49 50 style = Qt Gui.QApplication.style() if options.widget is None else options.widget.style()50 style = QtWidgets.QApplication.style() if options.widget is None else options.widget.style() 51 51 52 52 # Prepare document for inserting into cell … … 178 178 self.initStyleOption(options,index) 179 179 180 style = Qt Gui.QApplication.style() if options.widget is None else options.widget.style()180 style = QtWidgets.QApplication.style() if options.widget is None else options.widget.style() 181 181 182 182 # Prepare document for inserting into cell … … 256 256 self.initStyleOption(options,index) 257 257 258 style = Qt Gui.QApplication.style() if options.widget is None else options.widget.style()258 style = QtWidgets.QApplication.style() if options.widget is None else options.widget.style() 259 259 260 260 # Prepare document for inserting into cell -
src/sas/qtgui/Plotting/LinearFit.py
r0849aec r304d082 19 19 20 20 class LinearFit(QtWidgets.QDialog, Ui_LinearFitUI): 21 updatePlot = QtCore.pyqtSignal(tuple) 21 22 def __init__(self, parent=None, 22 23 data=None, … … 178 179 self.txtChi2.setText(formatNumber(self.Chivalue)) 179 180 180 #self.parent.updatePlot.emit((tempx, tempy)) 181 self.parent.emit(QtCore.SIGNAL('updatePlot'), (tempx, tempy)) 181 self.updatePlot.emit((tempx, tempy)) 182 182 183 183 def origData(self): -
src/sas/qtgui/Plotting/Plotter.py
r0849aec r304d082 21 21 1D Plot widget for use with a QDialog 22 22 """ 23 updatePlot = QtCore.pyqtSignal(tuple)24 23 def __init__(self, parent=None, manager=None, quickplot=False): 25 24 super(PlotterWidget, self).__init__(parent, manager=manager, quickplot=quickplot) … … 41 40 self.fit_result.symbol = 13 42 41 self.fit_result.name = "Fit" 43 44 # Add a slot for receiving update signal from LinearFit45 # NEW style signals46 self.updatePlot.connect(self.onFitDisplay)47 # OLD style signals48 # QtCore.QObject.connect(self, QtCore.SIGNAL('updatePlot'), self.onFitDisplay)49 42 50 43 @property … … 365 358 xlabel=self.xLogLabel, 366 359 ylabel=self.yLogLabel) 360 fit_dialog.updatePlot.connect(self.onFitDisplay) 367 361 if fit_dialog.exec_() == QtWidgets.QDialog.Accepted: 368 362 return -
src/sas/qtgui/Plotting/Plotter2D.py
r0849aec r304d082 243 243 self.slicer_widget.close_signal.connect(slicer_closed) 244 244 # Add the plot to the workspace 245 self.manager.parent.workspace().add Window(self.slicer_widget)245 self.manager.parent.workspace().addSubWindow(self.slicer_widget) 246 246 247 247 self.slicer_widget.show() … … 344 344 self.boxwidget = BoxSum(self, model=self.box_sum_model) 345 345 # Add the plot to the workspace 346 self.manager.parent.workspace().add Window(self.boxwidget)346 self.manager.parent.workspace().addSubWindow(self.boxwidget) 347 347 self.boxwidget.show() 348 348 -
src/sas/qtgui/Plotting/PlotterBase.py
r0849aec r304d082 317 317 Copy MPL widget area to buffer 318 318 """ 319 bmp = Qt Gui.QApplication.clipboard()319 bmp = QtWidgets.QApplication.clipboard() 320 320 pixmap = QtGui.QPixmap.grabWidget(self.canvas) 321 321 bmp.setPixmap(pixmap) … … 374 374 # Move the slider all the way up, if present 375 375 vertical_scroll_bar = self.txt_widget.verticalScrollBar() 376 vertical_scroll_bar.triggerAction(Qt Gui.QScrollBar.SliderToMinimum)376 vertical_scroll_bar.triggerAction(QtWidgets.QScrollBar.SliderToMinimum) 377 377 378 378 def onSavePoints(self, plot_data): -
src/sas/qtgui/Plotting/rangeSlider.py
r0849aec r304d082 89 89 90 90 painter = QtGui.QPainter(self) 91 style = Qt Gui.QApplication.style()91 style = QtWidgets.QApplication.style() 92 92 93 93 for i, value in enumerate([self._low, self._high]): … … 173 173 event.accept() 174 174 175 style = Qt Gui.QApplication.style()175 style = QtWidgets.QApplication.style() 176 176 button = event.button() 177 177 … … 264 264 self.setHighValue( new_pos ) 265 265 266 if self.hasTracking():267 self.emit(QtCore.SIGNAL('sliderMoved(int)'), new_pos)268 269 266 270 267 def __pick(self, pt): … … 278 275 opt = QtWidgets.QStyleOptionSlider() 279 276 self.initStyleOption(opt) 280 style = Qt Gui.QApplication.style()277 style = QtWidgets.QApplication.style() 281 278 282 279 gr = style.subControlRect(style.CC_Slider, opt, style.SC_SliderGroove, self)
Note: See TracChangeset
for help on using the changeset viewer.