Qt-interest Archive, February 2007
Using Qt to create plugins for other applications
Message 1 in thread
Hi. I have a Qt application and I want to create a web plugin version
of it. I want to use the Netscape plugin API as this is the most
compatible type of browser plugin.
During the load process, I get a NPWindow *. I want to be able to
create an instance of one of my QWidget derived classes and parent it
into this window. Is there a way in Qt to do this?
Thanks.
Brant Sears
--
[ signature omitted ]
Message 2 in thread
On Monday 26 February 2007 3:35 pm, Brant Sears wrote:
> Hi. I have a Qt application and I want to create a web plugin version
> of it. I want to use the Netscape plugin API as this is the most
> compatible type of browser plugin.
>
> During the load process, I get a NPWindow *. I want to be able to
> create an instance of one of my QWidget derived classes and parent it
> into this window. Is there a way in Qt to do this?
>
Something like this:
// this class is a wrapper around the NPWindow provided by the browser
class NPQWidget : public QWidget
{
Q_OBJECT
public:
NPQWidget(NPWindow*)
{
.. get the native window id from NPWindow
this->create( nativeWindowId );
}
~NPQWidget()
{
this->destroy(false, true);
}
};
Then you can make any QWidget the child of your NPQWidget.
I haven't tried that on the Mac. If you want it to work on Mac, you'll probably have to go an extra step into the HIView world.
Clint
Message 3 in thread
"Brant Sears" <brant@xxxxxxx> wrote in message
news:66E79EFE-BFA9-4142-BBCD-24EB951BAA2C@xxxxxxxxxx
> Hi. I have a Qt application and I want to create a web plugin version
> of it. I want to use the Netscape plugin API as this is the most
> compatible type of browser plugin.
>
> During the load process, I get a NPWindow *. I want to be able to
> create an instance of one of my QWidget derived classes and parent it
> into this window. Is there a way in Qt to do this?
>
> Thanks.
>
> Brant Sears
Hi Brant,
You could just try the QtBrowserPlugin solution:
http://www.trolltech.com/products/qt/addon/solutions/catalog/4/Utilities/qtbrowserplugin/
Volker
--
[ signature omitted ]