6 from Vispa.Share.BasicDataAccessor
import BasicDataAccessor
7 from Vispa.Views.TableView
import TableView
10 """ Table view that lists python configuration code.
13 LABEL =
"Python configuration code"
16 logging.debug(__name__ +
": __init__")
17 TableView.__init__(self,parent)
18 self.setColumns([
"Buttons",
"code"])
19 self.horizontalHeader().hide()
20 self.setSorting(
False)
23 self.connect(self, SIGNAL(
"itemClicked(QTableWidgetItem*)"), self.
itemClicked)
26 """ Create item for an object.
28 TableView._createItem(self, object, properties)
31 if self.dataAccessor().
label(object)==
"Import":
34 elif self.dataAccessor().
label(object)==
"Apply tool":
40 self.setCellWidget(self.rowCount()-1, 0, button)
43 self.emit(SIGNAL(
"importButtonClicked"),self.sender().object)
46 self.emit(SIGNAL(
"applyButtonClicked"),self.sender().object)
49 self.emit(SIGNAL(
"removeButtonClicked"),self.sender().object)
52 result=TableView.updateContent(self)
53 self.horizontalHeader().resizeSection(0,self.cellWidget(0,0).sizeHint().
width())
57 TableView.keyPressEvent(self,event)
58 if event.key()
in [Qt.Key_Backspace,Qt.Key_Delete]:
59 self.emit(SIGNAL(
"removeButtonClicked"),self.selection())
62 logging.debug(__name__ +
": itemClicked")
63 if not self._updatingFlag:
64 self.setCurrentCell(self.currentRow(),0)