[PyKDE] PyQt Qthreads
Gregor Kling
gregor.kling at dvz.fh-giessen.de
Wed Nov 1 12:04:30 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello Carles,
> Hope that will help...
Yes that does thanks.
But,..
In my thread, in which i do the db-query i have now following line:
for row in result:
host_id = row[0]
host = DVZhostData(self.__dbcon)
host.fill_host_by_host_id(host_id)
number=MyEvent.Type(MyEvent.User+0)
event = MyEvent(number)
event.set_data(host)
-->> QtGui.QApplication.sendEvent(self.gui,event)
In the MainWindow I have this eventFilter:
def eventFilter(self,object,event):
if(event.type() == QtCore.QEvent.Type(QtCore.QEvent.User+0)):
host = event.get_data()
self.update_host_find_dialog(host)
return True
return QtGui.QWidget.eventFilter(self,object,event)
The update_host_find_dialog(host) does:
if (self.first):
<setting the header>
nk = host.get_name_ipv4()[0]
host_id = nk.get_name()
tw.insertRow(row)
domain = host.get_domain_ipv4()
dname = domain.get_domain_name()
ti = QtGui.QTableWidgetItem()
ti.setText(str(host_id))
tw.setItem(row,0,ti)
ti = QtGui.QTableWidgetItem()
ti.setText(str(dname))
tw.setItem(row,1,ti)
self.row += 1
tw.resizeColumnsToContents()
print "RowCount: " + str(tw.rowCount())
I can see the RowCount is exactly coherent to the expected value,
but the tablewidget still is not dutiful in representing the data.
What am I missing ?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFFSI1OJFHWQ694uCYRAgnrAJ4mhnrvMbUn7uhTARv5Bmc0A2wERwCfb/1C
vD1WQxJkNf+5zxrfKH1V1cQ=
=fAWG
-----END PGP SIGNATURE-----
More information about the PyQt
mailing list