[PyKDE] QButton/QGridLayout woes
Hoka "ME" Tichenci
melkin at uci.edu
Mon Sep 19 04:07:02 BST 2005
I'm having an odd issue with Windows PyQt 3.14.1 Educational, the code is
supposed to dynamically add/remove buttons when called from a multithreaded
application. On Linux (PyQt 3.13 qt 3.3.4) the code runs fine, but on
Windows I get assert problems in a rather odd spot.
The code is here (bgrid is a QGridLayout, bg_projectors is a QButtonGroup):
print "adding projector rnode: %s" % rnode.getName()
attrs = rnode.getAttributes()
print "xpos: %s ypos: %s" % (attrs["xpos"],attrs["ypos"])
tmp = QPushButton(self.bg_projectors,"yes")
tmp.setText(rnode.getName())
print "qpushbutton built"
self.bgrid.addWidget(tmp,attrs["ypos"],attrs["xpos"])
print "widget added"
tmp.show()
print "Done adding projector!"
However, when run I get this output:
adding projector rnode: Projector: BigOne
xpos: 1 ypos: 1
qpushbutton built
projector is off
widget added
Done adding projector!
ASSERT: "src_dc && dst_dc" in kernel\qpaintdevice_win.cpp (388)
What's odd is that the ASSERT failure is at the end, after the method
should be done and printed its last statement. Furthermore, if I make a
QWarningBox or other similar piece of code pauses the system after
tmp.show() is called, the QButton can be seen in the background, after the
box is closed the button disappears, but oddly enough no ASSERT is thrown.
This may not be the right way to do something like this, and if it isn't
correct me, but I'm at a lost and Google didn't return anything worthwhile.
Thanks for your time,
-Hoka
More information about the PyQt
mailing list