|
Thanks for your quick reply. I thought that it was possible to have
multiple inheritance in Python. My original problem was to have a checkbox item in a table cell which could emit a signal when clicked. What I've done is to make a QObject data member as part of my CheckBoxItem class. Is this the only way to get this class to emit a signal when clicked? My class looks as follows: class CheckBoxTableItem(QTableItem): def __init__(self, parent, table, text): QTableItem.__init__(self, table, QTableItem.Always, text) self.emitter = QObject(parent) self.checkbox = None def setContentFromEditor(self, w): print 'CheckBoxTableItem::setContentFromEditor ' #DFD if self.checkbox: self.setText(self.checkbox.text()) def createEditor(self): print 'CheckBoxTableItem::createEditor ' #DFD self.checkbox = QCheckBox(self.table().viewport()) self.checkbox.connect(self.checkbox, SIGNAL("clicked()"), self.__Clicked) self.checkbox.setText(self.text()) self.checkbox.show() return self.checkbox def __Clicked(self): self.emitter.emit(PYSIGNAL("Clicked()"), ()) It's created as follows: checkItem = CheckBoxTableItem(self, self.testStatusTable, "Start") self.connect(checkItem.emitter, PYSIGNAL("Clicked()"), self.__CheckItemClicked) self.testStatusTable.setItem(row, 0, checkItem) Cheers Daryl Phil Thompson wrote: On Wednesday 26 April 2006 7:44 am, Daryl Dusheiko wrote:Hi, |
begin:vcard fn:Daryl Dusheiko n:Dusheiko;Daryl adr:;;65 Johnston St;Annandale;NSW;2038;Australia email;internet:[EMAIL PROTECTED] tel;work:+ 61 2 9562 9858 tel;fax:+61 2 9518 7620 url:http://www.magtech.com.au version:2.1 end:vcard
_______________________________________________ PyKDE mailing list [email protected] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
