Exemple #1
0
 def createAnalysisDock(self, mod):
     try:
         m = analysisModules.createAnalysisModule(mod, self)
         dock = QtGui.QDockWidget(mod)
         dock.setFeatures(dock.AllDockWidgetFeatures)
         dock.setAllowedAreas(QtCore.Qt.BottomDockWidgetArea|QtCore.Qt.TopDockWidgetArea)
         dock.setObjectName(mod)
         dock.setWidget(m)
         dock.setAutoFillBackground(True)
         
         self.analysisDocks[mod] = dock
         self.win.addDockWidget(QtCore.Qt.BottomDockWidgetArea, dock)
         if self.firstDock is None:
             self.firstDock = dock
         else:
             # by default, docks are tabbed. 
             # if dock state is stored, this will be corrected later.
             self.win.tabifyDockWidget(self.firstDock, dock)
             
         
         items = self.ui.analysisList.findItems(mod, QtCore.Qt.MatchExactly)
         items[0].setCheckState(QtCore.Qt.Checked)
         
         return True
     except:
         printExc("Analysis module creation failed:")
         return False
Exemple #2
0
    def createAnalysisDock(self, mod):
        try:
            m = analysisModules.createAnalysisModule(mod, self)
            dock = QtGui.QDockWidget(mod)
            dock.setFeatures(dock.AllDockWidgetFeatures)
            dock.setAllowedAreas(QtCore.Qt.BottomDockWidgetArea
                                 | QtCore.Qt.TopDockWidgetArea)
            dock.setObjectName(mod)
            dock.setWidget(m)
            dock.setAutoFillBackground(True)

            self.analysisDocks[mod] = dock
            self.win.addDockWidget(QtCore.Qt.BottomDockWidgetArea, dock)
            if self.firstDock is None:
                self.firstDock = dock
            else:
                # by default, docks are tabbed.
                # if dock state is stored, this will be corrected later.
                QtGui.QApplication.sendPostedEvents(
                    dock, 0)  # required to ensure new tab is visible
                self.win.tabifyDockWidget(self.firstDock, dock)

            items = self.ui.analysisList.findItems(mod, QtCore.Qt.MatchExactly)
            items[0].setCheckState(QtCore.Qt.Checked)

            return True
        except:
            printExc("Analysis module creation failed:")
            return False