[PyKDE] Odd window behavior when embedding ActiveX controls

Sundance sundance at ierne.eu.org
Wed Apr 9 19:06:00 BST 2003


I heard greg Landrum said:

> I'm working on embedding ActiveX controls in PyQt windows

Hmm. I'm not sure I'd call it 'embedding', since there's no immediate 
relation between Qt and your ActiveX, if I understood your code 
correctly (not sure about that -- ActiveX gives me the creeps).

Basically, your grey rectangle is, I surmise, your TestPanel, displayed 
as a small grey area because it simply doesn't contain anything, from 
Qt's point of view. It will likely disappear if you remove or comment 
out the line that says widg.show().

If you're just gonna play around with the IE aX, I don't think you need 
Qt at all, since the ActiveX comes with its own event loop and 
everything, if my memory serves.

If you really want some interaction between a Qt interface and the 
ActiveX, well, good luck. I'd say, there are three options:

1) Embed the ActiveX in a C++ Qt Widget using the ActiveQt C++ module, 
give it a simple interface, and SIP that widget into something 
pythonable.

2) Make your central Qt widget something 'invisible' (it ought to be 
possible one way or another...) and send the ActiveX move and resize 
events so that it stays within that invisible area. You'll still have 
to code the links between the Qt interface () an the ActiveX by hand. 
This includes Qt layout functions, that Qt calls when it needs to know 
if a widget can be resized, if it wants to at all, etc; your ActiveX 
knows nothing about Qt's layout magic, so you'll have to code it 
yourself.

3) Look at Phil Thompson cutely and ask him if he intends to make the 
ActiveQt framework from Qt 3 part of PyQt at some point. :)

BTW, your __del__() function is probably not necessary -- the reference 
counter will dispose of the IE wrapper on its own.

-- S.




More information about the PyQt mailing list