QNPWidget(3qt)

NAME
QNPWidget - A

#include <qnp.h>

Inherits QWidget.

  Public Members
QNPWidget ()
~QNPWidget ()
void setWindow ( bool )
void unsetWindow ()
virtual void enterInstance ()
virtual void leaveInstance ()
QNPInstance* instance ()

DESCRIPTION
This class is defined in the Qt NSPlugin Extension, which can be found in the qt/extensions directory. It is not included in the main Qt API.

A QWidget that is a Web-browser plugin window

Derive from QNPWidget to create a widget that can be used as a Browser plugin window, or create one and add child widgets. Instances of QNPWidget may only be created when QNPInstance::newWindow() is called by the browser.

A common way to develop a plugin widget is to develop it as a stand-alone application window, then make it a child of a plugin widget to use it as a browser plugin. The technique is:

class MyPluginWindow : public QNPWidget {
    QWidget* child;
public:
    MyPluginWindow()
    {
        // Some widget that is normally used as a top-level widget
        child = new MyIndependentlyDevelopedWidget();
        // Use the background color of the web page
        child->setBackgroundColor( backgroundColor() );
        // Fill the plugin widget
        child->setGeometry( 0, 0, width(), height() );
    }
    void resizeEvent(QResizeEvent*)
    {
        // Fill the plugin widget
        child->resize(size());
    }
};

The default implementation is an empty window.

Examples: qtimage/qtimage.cpp grapher/grapher.cpp trivial/trivial.cpp

MEMBER FUNCTION DOCUMENTATION

QNPWidget::QNPWidget ()
Creates a QNPWidget.

QNPWidget::~QNPWidget ()
Destroys the window. This will be called by the plugin binding code when the window is no longer required. The Web-browser will delete windows when they leave the page. The bindings will change the QWidget::winId() of the window when the window is resized, but this should not affect normal widget behavior.

void QNPWidget::enterInstance () [virtual]
Called when the mouse enters the plugin window. Default does nothing.

QNPInstance* QNPWidget::instance ()
Returns the instance for which this widget is the window.

void QNPWidget::leaveInstance () [virtual]
Called when the mouse leaves the plugin window. Default does nothing.

void QNPWidget::setWindow ( bool delold )
For internal use only.

void QNPWidget::show () [virtual]
This is needed in order to show plugins correctly on Windows. Does nothing on X11.

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

void QNPWidget::unsetWindow ()
For internal use only.

SEE ALSO
http://doc.trolltech.com/qnpwidget.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports make our job much simpler. Thank you.

In case of content or formattting problems with this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qnpwidget.3qt) and the Qt version (2.3.1).