[PyKDE] KPopupFrame problem/PyKDE Update

Jim Bublitz jbublitz at nwinternet.com
Sat Jul 10 08:57:01 BST 2004


There is a problem with the KPopupFrame in kdatelbl.h/.cpp when used in PyKDE 
(haven't tried it in C++). It produces a window with WType_Popup set, so it 
behaves similarly to a popup menu - if you click outside the KPopupFrame 
window it disappears and should destroy itself, even if run with exec (exec_ 
in PyKDE due to the keyword conflict), and return to the caller.

However, close() never returns to the caller until application exit, at which 
time it finds the underlying C++ object instance no longer exists, so it 
crashes on exit. You should be able to subclass KPopupFrame and overload 
close (), but close() itself is overloading virtual int QFrame::close (bool) 
with void KPopupFrame::close(int), and sip virtual handling code will crash 
unless your overloaded Python close() returns an int instead of None (for 
void).

What I did instead for the app I'm writing was just completely convert 
KPopupFrame from C++ to Python, which is fairly easy - it's not a complex 
class. 

I still need to look into how to fix KPopupFrame - might be an error in how 
I've written the sip file too. There are several ways to make it work more 
reliably from Python.

-------------------------

I have the KDE 3.3beta1 rpms downloaded and a machine setup for them, but I 
haven't found time to install them. It should only take a day or two to test 
out the PyKDE version that supports the beta, but I'm in the middle of 
writing some code I have to get done, so it may take a while to get to a 
snapshot release of PyKDE. 

If someone has an urgent need, let me know and I'll try to work it in earlier.

Jim




More information about the PyQt mailing list