Ignore:
Timestamp:
Nov 9, 2017 8:43:07 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
fbfc488
Parents:
4992ff2
git-author:
Piotr Rozyczko <rozyczko@…> (10/31/17 10:00:59)
git-committer:
Piotr Rozyczko <rozyczko@…> (11/09/17 08:43:07)
Message:

More functionality conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    r4992ff2 r7969b9c  
    182182        Opens the Qt "Open File..." dialog 
    183183        """ 
    184         print("A") 
    185184        path_str = self.chooseFiles() 
    186185        if not path_str: 
     
    193192        Opens the Qt "Open Folder..." dialog 
    194193        """ 
    195         folder = QtWidgets.QFileDialog.getExistingDirectory(self, "Choose a directory", "", None, 
     194        folder = QtWidgets.QFileDialog.getExistingDirectory(self, "Choose a directory", "", 
    196195              QtWidgets.QFileDialog.ShowDirsOnly | QtWidgets.QFileDialog.DontUseNativeDialog) 
    197196        if folder is None: 
     
    398397            if outer_item.isCheckable() and \ 
    399398                   outer_item.checkState() == QtCore.Qt.Checked: 
     399                self.model.beginResetModel() 
    400400                theories_copied += 1 
    401401                new_item = self.recursivelyCloneItem(outer_item) 
     
    405405                new_item.setText(new_name) 
    406406                self.model.appendRow(new_item) 
    407             self.model.reset() 
     407                self.model.endResetModel() 
     408            #self.model.reset() 
    408409 
    409410        freeze_msg = "" 
     
    577578 
    578579        # Add the plot to the workspace 
    579         self.parent.workspace().addWindow(new_plot) 
     580        self.parent.workspace().addSubWindow(new_plot) 
    580581 
    581582        # Show the plot 
     
    626627        # But only with Qt built-in dialog (non-platform native) 
    627628        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! 
    629631        if paths is None: 
    630632            return 
     
    686688                    self.mutex.lock() 
    687689                    self.updateModel(new_data, p_file) 
    688                     self.model.reset() 
    689                     QtGui.qApp.processEvents() 
     690                    #self.model.reset() 
     691                    QtWidgets.QApplication.processEvents() 
    690692                    self.mutex.unlock() 
    691693 
     
    907909        # Move the slider all the way up, if present 
    908910        vertical_scroll_bar = self.txt_widget.verticalScrollBar() 
    909         vertical_scroll_bar.triggerAction(QtGui.QScrollBar.SliderToMinimum) 
     911        vertical_scroll_bar.triggerAction(QtWidgets.QScrollBar.SliderToMinimum) 
    910912 
    911913    def saveDataAs(self): 
     
    995997 
    996998        # Reset the model so the view gets updated. 
    997         self.model.reset() 
     999        #self.model.reset() 
    9981000        self.communicator.progressBarUpdateSignal.emit(-1) 
    9991001 
     
    10051007        self.manager.add_data(data_list=output_data) 
    10061008 
    1007     def loadErrback(self, reason): 
     1009    def loadFailed(self, reason): 
    10081010        print("File Load Failed with:\n", reason) 
    10091011        pass 
     
    10471049 
    10481050        # New row in the model 
     1051        self.model.beginResetModel() 
    10491052        self.model.appendRow(checkbox_item) 
     1053        self.model.endResetModel() 
    10501054 
    10511055    def updateModelFromPerspective(self, model_item): 
     
    10621066 
    10631067        # Reset the view 
    1064         self.model.reset() 
     1068        ##self.model.reset() 
    10651069        # Pass acting as a debugger anchor 
    10661070        pass 
     
    10981102 
    10991103if __name__ == "__main__": 
    1100     app = QtGui.QApplication([]) 
     1104    app = QtWidgets.QApplication([]) 
    11011105    dlg = DataExplorerWindow() 
    11021106    dlg.show() 
Note: See TracChangeset for help on using the changeset viewer.