[Qt-interest] Hosting plug-in UIs within Qt application

Glenn Hughes ghughes02138 at gmail.com
Fri Jun 25 05:20:14 CEST 2010


Hi all,

I am writing a Qt app that needs to host plug-ins. The plug-ins
display themselves in my app's (Qt) windows and my app spoon feeds
events and redraw messages to them. In some ways this is pretty simple
because I hand all events to the plug-ins (they don't have their own
event loop).

However I need to provide a coherent drawing environment for the plug-in.

On the Mac, I need to be able to set up the port (CGrafPtr or
CGContextRef) and the origin for plug-ins.
Under Windows I need to be able to hand them an HDC.
I'll don't have to deal with Linux just yet, but eventually... (know
nothing about the drawing model).

Additionally, the plug-ins are expecting to be able to tell my app to
Prepare the drawing environment for them (set the port and origin on
the Mac)... I need to be able to do this in a way that does not screw
up Qt's drawing environment when it goes to draw later on.

So, I need to know a few things about how Qt manages the drawing
environment, and how to get at the underlying OS objects.

1) How does Qt set up the port and the origin when drawing under
Carbon? Is there a way to tell Qt that the port and origin are "dirty"
and need to be reset?
2) How can I get at the port (CGrafPtr or CGContextRef) on the Mac?
3) How can I get an HDC under Windows?

Any other pointers or information anyone has?

Thanks and best wishes
Glenn Hughes



More information about the Qt-interest-old mailing list