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
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
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)
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)
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)
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)
def keyPressEvent(self,event): TableView.keyPressEvent(self,event) if event.key() in [Qt.Key_Backspace,Qt.Key_Delete]: self.emit(SIGNAL("removeButtonClicked"),self.selection())
def updateContent(self): result=TableView.updateContent(self) self.horizontalHeader().resizeSection(0,self.cellWidget(0,0).sizeHint().width()) return result
def selection(self): return self.dataAccessor().read(TableView.selection(self))
def keyPressEvent(self, event): TableView.keyPressEvent(self, event) if event.key() in [Qt.Key_Backspace, Qt.Key_Delete]: self.emit(SIGNAL("removeButtonClicked"), self.selection())
def updateContent(self): result = TableView.updateContent(self) self.horizontalHeader().resizeSection( 0, self.cellWidget(0, 0).sizeHint().width()) return result