예제 #1
0
    def setDataSource(self, datasource):
        if DEBUG:
            print("setDataSource(self, datasource) called")
            print("datasource = ", datasource)
        self.data = datasource
        self.refresh()
        if QTVERSION < '4.0.0':return

        if not self.autoAddBox.isChecked():
            return
        #If there is only one mca containing scan
        # and we are in auto add mode, I plot it.
        if len(self.scans) == 1:
            item = self.list.itemAt(qt.QPoint(0,0))
            if item is not None:
                item.setSelected(True)
                self.__selectionChanged()
예제 #2
0
 def infoReparent(self):
     if qt.qVersion() < '4.0.0':
         if self.infoWidget.parent() is not None:
             self.infoWidget.reparent(None, self.cursor().pos(), 1)
         else:
             self.infoWidget.reparent(self.splitter, qt.QPoint(), 1)
             #self.splitter.moveToFirst(self.sourceFrame)
     else:
         if self.infoWidget.parent() is not None:
             self.infoWidget.setParent(None)
             self.infoWidget.move(self.cursor().pos())
             self.infoWidget.show()
             #,self.cursor().pos(),1)
         else:
             self.infoWidget.setParent(self.splitter)
             self.splitter.insertWidget(1, self.infoWidget)
             #,qt.QPoint(),1)
             #self.splitter.moveToFirst(self.sourceFrame)
         self.infoWidget.setFocus()