Пример #1
0
 def __init__(self, parent=None):
     logging.debug(__name__ + ": __init__")
     TableView.__init__(self,parent)
     self.setColumns(["Type","Label","Product","Process"])
     self._firstColumn=0
     self._autosizeColumns=False
     self._sortingFlag=True
Пример #2
0
 def __init__(self, parent=None):
     logging.debug(__name__ + ": __init__")
     TableView.__init__(self, parent)
     self.setColumns(["Type", "Label", "Product", "Process"])
     self._firstColumn = 0
     self._autosizeColumns = False
     self._sortingFlag = True
Пример #3
0
    def __init__(self, parent=None):
        logging.debug(__name__ + ": __init__")
        TableView.__init__(self,parent)
        self.setColumns(["Buttons","code"])
        self.horizontalHeader().hide()
        self.setSorting(False)
        self._firstColumn=1

        self.connect(self, SIGNAL("itemClicked(QTableWidgetItem*)"), self.itemClicked)
Пример #4
0
    def __init__(self, parent=None):
        logging.debug(__name__ + ": __init__")
        TableView.__init__(self, parent)
        self.setColumns(["Buttons", "code"])
        self.horizontalHeader().hide()
        self.setSorting(False)
        self._firstColumn = 1

        self.connect(self, SIGNAL("itemClicked(QTableWidgetItem*)"),
                     self.itemClicked)
Пример #5
0
 def _createItem(self, object, properties):
     """ Create item for an object.
     """
     TableView._createItem(self, object, properties)
     button=QToolButton()
     button.object=object
     if self.dataAccessor().label(object)=="Import":
         button.setText("...")
         self.connect(button, SIGNAL('clicked(bool)'), self.importButtonClicked)
     elif self.dataAccessor().label(object)=="Apply tool":
         button.setText("+")
         self.connect(button, SIGNAL('clicked(bool)'), self.applyButtonClicked)
     else:
         button.setText("X")
         self.connect(button, SIGNAL('clicked(bool)'), self.removeButtonClicked)
     self.setCellWidget(self.rowCount()-1, 0, button)
Пример #6
0
 def _createItem(self, object, properties):
     """ Create item for an object.
     """
     TableView._createItem(self, object, properties)
     button = QToolButton()
     button.object = object
     if self.dataAccessor().label(object) == "Import":
         button.setText("...")
         self.connect(button, SIGNAL('clicked(bool)'),
                      self.importButtonClicked)
     elif self.dataAccessor().label(object) == "Apply tool":
         button.setText("+")
         self.connect(button, SIGNAL('clicked(bool)'),
                      self.applyButtonClicked)
     else:
         button.setText("X")
         self.connect(button, SIGNAL('clicked(bool)'),
                      self.removeButtonClicked)
     self.setCellWidget(self.rowCount() - 1, 0, button)
Пример #7
0
 def keyPressEvent(self,event):
     TableView.keyPressEvent(self,event)
     if event.key() in [Qt.Key_Backspace,Qt.Key_Delete]:    
         self.emit(SIGNAL("removeButtonClicked"),self.selection())
Пример #8
0
 def updateContent(self):
     result=TableView.updateContent(self)
     self.horizontalHeader().resizeSection(0,self.cellWidget(0,0).sizeHint().width())
     return result
Пример #9
0
 def selection(self):
     return self.dataAccessor().read(TableView.selection(self))
Пример #10
0
 def selection(self):
     return self.dataAccessor().read(TableView.selection(self))
Пример #11
0
 def keyPressEvent(self, event):
     TableView.keyPressEvent(self, event)
     if event.key() in [Qt.Key_Backspace, Qt.Key_Delete]:
         self.emit(SIGNAL("removeButtonClicked"), self.selection())
Пример #12
0
 def updateContent(self):
     result = TableView.updateContent(self)
     self.horizontalHeader().resizeSection(
         0,
         self.cellWidget(0, 0).sizeHint().width())
     return result