Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 2035

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QGLWidget" doc="/**
&lt;p&gt;The &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; class is a widget for rendering OpenGL graphics.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; provides functionality for displaying OpenGL graphics integrated into a Qt application. It is very simple to use. You inherit from it and use the subclass like any other &lt;a href=&quot;%2E%2E/gui/%2E%2E/gui/QWidget.html#QWidget(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QWidget&lt;/tt&gt;&lt;/a&gt;, except that you have the choice between using &lt;a href=&quot;%2E%2E/gui/QPainter.html&quot;&gt;&lt;tt&gt;QPainter&lt;/tt&gt;&lt;/a&gt; and standard OpenGL rendering commands.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; provides three convenient virtual functions that you can reimplement in your subclass to perform the typical OpenGL tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; - Renders the OpenGL scene. Gets called whenever the widget needs to be updated.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QGLWidget.html#resizeGL(int, int)&quot;&gt;&lt;tt&gt;resizeGL&lt;/tt&gt;&lt;/a&gt; - Sets up the OpenGL viewport, projection, etc. Gets called whenever the the widget has been resized (and also when it is shown for the first time because all newly created widgets get a resize event automatically).&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt; - Sets up the OpenGL rendering context, defines display lists, etc. Gets called once before the first time &lt;a href=&quot;QGLWidget.html#resizeGL(int, int)&quot;&gt;&lt;tt&gt;resizeGL&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; is called.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is a rough outline of how a &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; subclass might look:&lt;/p&gt;
&lt;pre&gt;    class MyGLDrawer : public QGLWidget
    {
        Q_OBJECT        &lt;span class=&quot;comment&quot;&gt;// must include this if you use Qt signals/slots&lt;/span&gt;

    public:
        MyGLDrawer(QWidget *parent)
            : QGLWidget(parent) {}

    protected:

        void initializeGL()
        {
            &lt;span class=&quot;comment&quot;&gt;// Set up the rendering context, define display lists etc.:&lt;/span&gt;
            ...
            glClearColor(0.0, 0.0, 0.0, 0.0);
            glEnable(GL_DEPTH_TEST);
            ...
        }

        void resizeGL(int w, int h)
        {
            &lt;span class=&quot;comment&quot;&gt;// setup viewport, projection etc.:&lt;/span&gt;
            glViewport(0, 0, (GLint)w, (GLint)h);
            ...
            glFrustum(...);
            ...
        }

        void paintGL()
        {
            &lt;span class=&quot;comment&quot;&gt;// draw the scene:&lt;/span&gt;
            ...
            glRotatef(...);
            glMaterialfv(...);
            glBegin(GL_QUADS);
            glVertex3f(...);
            glVertex3f(...);
            ...
            glEnd();
            ...
        }

    };&lt;/pre&gt;
&lt;p&gt;If you need to trigger a repaint from places other than &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; (a typical example is when using &lt;a href=&quot;%2E%2E/core/QTimer.html&quot;&gt;timers&lt;/tt&gt;&lt;/a&gt; to animate scenes), you should call the widget's &lt;a href=&quot;QGLWidget.html#updateGL()&quot;&gt;&lt;tt&gt;updateGL&lt;/tt&gt;&lt;/a&gt; function.&lt;/p&gt;
&lt;p&gt;Your widget's OpenGL rendering context is made current when &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QGLWidget.html#resizeGL(int, int)&quot;&gt;&lt;tt&gt;resizeGL&lt;/tt&gt;&lt;/a&gt;, or &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt; is called. If you need to call the standard OpenGL API functions from other places (e.g&amp;#x2e; in your widget's constructor or in your own paint functions), you must call &lt;a href=&quot;QGLWidget.html#makeCurrent()&quot;&gt;&lt;tt&gt;makeCurrent&lt;/tt&gt;&lt;/a&gt; first.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; provides functions for requesting a new display &lt;a href=&quot;QGLFormat.html&quot;&gt;format&lt;/tt&gt;&lt;/a&gt; and you can also create widgets with customized rendering &lt;a href=&quot;QGLContext.html&quot;&gt;contexts&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can also share OpenGL display lists between QGLWidgets (see the documentation of the &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; constructors for details).&lt;/p&gt;
&lt;a name=&quot;overlays&quot;&gt;&lt;/a&gt;
&lt;h3&gt;Overlays&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; creates a GL overlay context in addition to the normal context if overlays are supported by the underlying system.&lt;/p&gt;
&lt;p&gt;If you want to use overlays, you specify it in the &lt;a href=&quot;QGLFormat.html&quot;&gt;format&lt;/tt&gt;&lt;/a&gt;. (Note: Overlay must be requested in the format passed to the &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; constructor.) Your GL widget should also implement some or all of these virtual methods:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;QGLWidget.html#paintOverlayGL()&quot;&gt;&lt;tt&gt;paintOverlayGL&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QGLWidget.html#resizeOverlayGL(int, int)&quot;&gt;&lt;tt&gt;resizeOverlayGL&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QGLWidget.html#initializeOverlayGL()&quot;&gt;&lt;tt&gt;initializeOverlayGL&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These methods work in the same way as the normal &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; etc. functions, except that they will be called when the overlay context is made current. You can explicitly make the overlay context current by using &lt;a href=&quot;QGLWidget.html#makeOverlayCurrent()&quot;&gt;&lt;tt&gt;makeOverlayCurrent&lt;/tt&gt;&lt;/a&gt;, and you can access the overlay context directly (e.g&amp;#x2e; to ask for its transparent color) by calling &lt;a href=&quot;QGLWidget.html#overlayContext()&quot;&gt;&lt;tt&gt;overlayContext&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;On X servers in which the default visual is in an overlay plane, non-GL Qt windows can also be used for overlays.&lt;/p&gt;
&lt;a name=&quot;painting-techniques&quot;&gt;&lt;/a&gt;
&lt;h3&gt;Painting Techniques&lt;/h3&gt;
&lt;p&gt;As described above, subclass &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; to render pure 3D content in the following way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reimplement the QGLWidget::initializeGL() and QGLWidget::resizeGL() to set up the OpenGL state and provide a perspective transformation.&lt;/li&gt;
&lt;li&gt;Reimplement QGLWidget::paintGL() to paint the 3D scene, calling only OpenGL functions to draw on the widget.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is also possible to draw 2D graphics onto a &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; subclass, it is necessary to reimplement QGLWidget::paintEvent() and do the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Construct a &lt;a href=&quot;%2E%2E/gui/QPainter.html&quot;&gt;&lt;tt&gt;QPainter&lt;/tt&gt;&lt;/a&gt; object.&lt;/li&gt;
&lt;li&gt;Initialize it for use on the widget with the QPainter::begin() function.&lt;/li&gt;
&lt;li&gt;Draw primitives using &lt;a href=&quot;%2E%2E/gui/QPainter.html&quot;&gt;&lt;tt&gt;QPainter&lt;/tt&gt;&lt;/a&gt;'s member functions.&lt;/li&gt;
&lt;li&gt;Call QPainter::end() to finish painting.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Overpainting 2D content on top of 3D content takes a little more effort. One approach to doing this is shown in the Overpainting&lt;/tt&gt; example.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.&lt;/i&gt;&lt;/p&gt;

@see &lt;a href=&quot;QGLPixelBuffer.html&quot;&gt;&lt;tt&gt;QGLPixelBuffer&lt;/tt&gt;&lt;/a&gt;
@see Hello GL Example&lt;/tt&gt;
@see 2D Painting Example&lt;/tt&gt;
@see Overpainting Example&lt;/tt&gt;
@see Grabber Example&lt;/tt&gt; */">
    <signal name="protected final void customContextMenuRequested(com.trolltech.qt.core.QPoint pos)" doc="/**
&lt;p&gt;This signal is emitted when the widget's &lt;a href=&quot;%2E%2E/gui/%2E%2E/gui/QWidget.html#contextMenuPolicy()&quot;&gt;&lt;tt&gt;contextMenuPolicy&lt;/tt&gt;&lt;/a&gt; is Qt::CustomContextMenu, and the user has requested a context menu on the widget. The position &lt;tt&gt;pos&lt;/tt&gt; is the position of the context menu event that the widget receives. Normally this is in widget coordinates. The exception to this rule is &lt;a href=&quot;%2E%2E/gui/QAbstractScrollArea.html&quot;&gt;&lt;tt&gt;QAbstractScrollArea&lt;/tt&gt;&lt;/a&gt; and its subclasses that map the context menu event to coordinates of the viewport()&lt;/tt&gt; .&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.core.QPoint pos)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;%2E%2E/gui/%2E%2E/gui/QWidget.html#mapToGlobal(com.trolltech.qt.core.QPoint)&quot;&gt;&lt;tt&gt;mapToGlobal&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;%2E%2E/gui/QMenu.html&quot;&gt;&lt;tt&gt;QMenu&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;%2E%2E/gui/%2E%2E/gui/QWidget.html#contextMenuPolicy()&quot;&gt;&lt;tt&gt;contextMenuPolicy&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <method name="public QGLWidget(com.trolltech.qt.opengl.QGLFormat format, com.trolltech.qt.gui.QWidget parent, com.trolltech.qt.opengl.QGLWidget shareWidget, com.trolltech.qt.core.Qt.WindowFlags f)" doc="/**
&lt;p&gt;Constructs an OpenGL widget with parent &lt;tt&gt;parent&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;tt&gt;format&lt;/tt&gt; argument specifies the desired &lt;a href=&quot;QGLFormat.html&quot;&gt;rendering options&lt;/tt&gt;&lt;/a&gt;. If the underlying OpenGL/Window system cannot satisfy all the features requested in &lt;tt&gt;format&lt;/tt&gt;, the nearest subset of features will be used. After creation, the &lt;a href=&quot;QGLWidget.html#format()&quot;&gt;&lt;tt&gt;format&lt;/tt&gt;&lt;/a&gt; method will return the actual format obtained.&lt;/p&gt;
&lt;p&gt;The widget will be &lt;a href=&quot;QGLWidget.html#isValid()&quot;&gt;invalid&lt;/tt&gt;&lt;/a&gt; if the system has no OpenGL support&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;tt&gt;parent&lt;/tt&gt; and widget flag, &lt;tt&gt;f&lt;/tt&gt;, arguments are passed to the &lt;a href=&quot;%2E%2E/gui/%2E%2E/gui/QWidget.html#QWidget(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QWidget&lt;/tt&gt;&lt;/a&gt; constructor.&lt;/p&gt;
&lt;p&gt;If the &lt;tt&gt;shareWidget&lt;/tt&gt; parameter points to a valid &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;, this widget will share OpenGL display lists with &lt;tt&gt;shareWidget&lt;/tt&gt;. If this widget and &lt;tt&gt;shareWidget&lt;/tt&gt; have different &lt;a href=&quot;QGLWidget.html#format()&quot;&gt;formats&lt;/tt&gt;&lt;/a&gt;, display list sharing may fail. You can check whether display list sharing succeeded by calling &lt;a href=&quot;QGLWidget.html#isSharing()&quot;&gt;&lt;tt&gt;isSharing&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The initialization of OpenGL rendering state, etc. should be done by overriding the &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt; function, rather than in the constructor of your &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; subclass.&lt;/p&gt;

@see &lt;tt&gt;QGLFormat::defaultFormat&lt;/tt&gt;
@see &lt;a href=&quot;QGLWidget.html#isValid()&quot;&gt;&lt;tt&gt;isValid&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public QGLWidget(com.trolltech.qt.opengl.QGLFormat format, com.trolltech.qt.gui.QWidget parent, com.trolltech.qt.opengl.QGLWidget shareWidget)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;format&lt;/tt&gt;, &lt;tt&gt;parent&lt;/tt&gt;, &lt;tt&gt;shareWidget&lt;/tt&gt;, 0). */"/>
    <method name="public QGLWidget(com.trolltech.qt.opengl.QGLFormat format, com.trolltech.qt.gui.QWidget parent)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;format&lt;/tt&gt;, &lt;tt&gt;parent&lt;/tt&gt;, 0, 0). */"/>
    <method name="public QGLWidget(com.trolltech.qt.opengl.QGLFormat format)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;format&lt;/tt&gt;, 0, 0, 0). */"/>
    <method name="public QGLWidget(com.trolltech.qt.gui.QWidget parent, com.trolltech.qt.opengl.QGLWidget shareWidget, com.trolltech.qt.core.Qt.WindowFlags f)" doc="/**
&lt;p&gt;Constructs an OpenGL widget with a &lt;tt&gt;parent&lt;/tt&gt; widget.&lt;/p&gt;
&lt;p&gt;The default format&lt;/tt&gt; is used. The widget will be &lt;a href=&quot;QGLWidget.html#isValid()&quot;&gt;invalid&lt;/tt&gt;&lt;/a&gt; if the system has no OpenGL support&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;tt&gt;parent&lt;/tt&gt; and widget flag, &lt;tt&gt;f&lt;/tt&gt;, arguments are passed to the &lt;a href=&quot;%2E%2E/gui/%2E%2E/gui/QWidget.html#QWidget(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QWidget&lt;/tt&gt;&lt;/a&gt; constructor.&lt;/p&gt;
&lt;p&gt;If the &lt;tt&gt;shareWidget&lt;/tt&gt; parameter points to a valid &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;, this widget will share OpenGL display lists with &lt;tt&gt;shareWidget&lt;/tt&gt;. If this widget and &lt;tt&gt;shareWidget&lt;/tt&gt; have different &lt;a href=&quot;QGLWidget.html#format()&quot;&gt;formats&lt;/tt&gt;&lt;/a&gt;, display list sharing may fail. You can check whether display list sharing succeeded by calling &lt;a href=&quot;QGLWidget.html#isSharing()&quot;&gt;&lt;tt&gt;isSharing&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The initialization of OpenGL rendering state, etc. should be done by overriding the &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt; function, rather than in the constructor of your &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; subclass.&lt;/p&gt;

@see &lt;tt&gt;QGLFormat::defaultFormat&lt;/tt&gt;
@see Textures Example&lt;/tt&gt; */"/>
    <method name="public QGLWidget(com.trolltech.qt.gui.QWidget parent, com.trolltech.qt.opengl.QGLWidget shareWidget)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;parent&lt;/tt&gt;, &lt;tt&gt;shareWidget&lt;/tt&gt;, 0). */"/>
    <method name="public QGLWidget(com.trolltech.qt.gui.QWidget parent)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;parent&lt;/tt&gt;, 0, 0). */"/>
    <method name="public QGLWidget()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;(0, 0, 0). */"/>
    <method name="public QGLWidget(com.trolltech.qt.opengl.QGLContext context, com.trolltech.qt.gui.QWidget parent, com.trolltech.qt.opengl.QGLWidget shareWidget, com.trolltech.qt.core.Qt.WindowFlags f)" doc="/**
&lt;p&gt;Constructs an OpenGL widget with parent &lt;tt&gt;parent&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;tt&gt;context&lt;/tt&gt; argument is a pointer to the &lt;a href=&quot;QGLContext.html&quot;&gt;&lt;tt&gt;QGLContext&lt;/tt&gt;&lt;/a&gt; that you wish to be bound to this widget. This allows you to pass in your own &lt;a href=&quot;QGLContext.html&quot;&gt;&lt;tt&gt;QGLContext&lt;/tt&gt;&lt;/a&gt; sub-classes.&lt;/p&gt;
&lt;p&gt;The widget will be &lt;a href=&quot;QGLWidget.html#isValid()&quot;&gt;invalid&lt;/tt&gt;&lt;/a&gt; if the system has no OpenGL support&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;tt&gt;parent&lt;/tt&gt; and widget flag, &lt;tt&gt;f&lt;/tt&gt;, arguments are passed to the &lt;a href=&quot;%2E%2E/gui/%2E%2E/gui/QWidget.html#QWidget(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QWidget&lt;/tt&gt;&lt;/a&gt; constructor.&lt;/p&gt;
&lt;p&gt;If the &lt;tt&gt;shareWidget&lt;/tt&gt; parameter points to a valid &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;, this widget will share OpenGL display lists with &lt;tt&gt;shareWidget&lt;/tt&gt;. If this widget and &lt;tt&gt;shareWidget&lt;/tt&gt; have different &lt;a href=&quot;QGLWidget.html#format()&quot;&gt;formats&lt;/tt&gt;&lt;/a&gt;, display list sharing may fail. You can check whether display list sharing succeeded by calling &lt;a href=&quot;QGLWidget.html#isSharing()&quot;&gt;&lt;tt&gt;isSharing&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The initialization of OpenGL rendering state, etc. should be done by overriding the &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt; function, rather than in the constructor of your &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt; subclass.&lt;/p&gt;

@see &lt;tt&gt;QGLFormat::defaultFormat&lt;/tt&gt;
@see &lt;a href=&quot;QGLWidget.html#isValid()&quot;&gt;&lt;tt&gt;isValid&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public QGLWidget(com.trolltech.qt.opengl.QGLContext context, com.trolltech.qt.gui.QWidget parent, com.trolltech.qt.opengl.QGLWidget shareWidget)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;context&lt;/tt&gt;, &lt;tt&gt;parent&lt;/tt&gt;, &lt;tt&gt;shareWidget&lt;/tt&gt;, 0). */"/>
    <method name="public QGLWidget(com.trolltech.qt.opengl.QGLContext context, com.trolltech.qt.gui.QWidget parent)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;context&lt;/tt&gt;, &lt;tt&gt;parent&lt;/tt&gt;, 0, 0). */"/>
    <method name="public QGLWidget(com.trolltech.qt.opengl.QGLContext context)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#QGLWidget(com.trolltech.qt.opengl.QGLContext, com.trolltech.qt.gui.QWidget, com.trolltech.qt.opengl.QGLWidget, com.trolltech.qt.core.Qt.WindowFlags)&quot;&gt;&lt;tt&gt;QGLWidget&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;context&lt;/tt&gt;, 0, 0, 0). */"/>
    <method name="protected final boolean autoBufferSwap()" doc="/**
&lt;p&gt;Returns true if the widget is doing automatic GL buffer swapping; otherwise returns false.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#setAutoBufferSwap(boolean)&quot;&gt;&lt;tt&gt;setAutoBufferSwap&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int bindTexture(java.lang.String fileName)" doc="/**
&lt;p&gt;Calls QGLContext::bindTexture(&lt;tt&gt;fileName&lt;/tt&gt;) on the currently set context.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#deleteTexture(int)&quot;&gt;&lt;tt&gt;deleteTexture&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int bindTexture(com.trolltech.qt.gui.QPixmap pixmap, int target, int format)" doc="/**
&lt;p&gt;Calls QGLContext:::&lt;a href=&quot;QGLWidget.html#bindTexture(com.trolltech.qt.gui.QImage, int, int)&quot;&gt;&lt;tt&gt;bindTexture&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;pixmap&lt;/tt&gt;, &lt;tt&gt;target&lt;/tt&gt;, &lt;tt&gt;format&lt;/tt&gt;) on the currently set context.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#deleteTexture(int)&quot;&gt;&lt;tt&gt;deleteTexture&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int bindTexture(com.trolltech.qt.gui.QPixmap pixmap, int target)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#bindTexture(com.trolltech.qt.gui.QImage, int, int)&quot;&gt;&lt;tt&gt;bindTexture&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;pixmap&lt;/tt&gt;, &lt;tt&gt;target&lt;/tt&gt;, GL_RGBA). */"/>
    <method name="public final int bindTexture(com.trolltech.qt.gui.QPixmap pixmap)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#bindTexture(com.trolltech.qt.gui.QImage, int, int)&quot;&gt;&lt;tt&gt;bindTexture&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;pixmap&lt;/tt&gt;, GL_TEXTURE_2D, GL_RGBA). */"/>
    <method name="public final int bindTexture(com.trolltech.qt.gui.QImage image, int target, int format)" doc="/**
&lt;p&gt;Calls QGLContext:::&lt;a href=&quot;QGLWidget.html#bindTexture(com.trolltech.qt.gui.QImage, int, int)&quot;&gt;&lt;tt&gt;bindTexture&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;image&lt;/tt&gt;, &lt;tt&gt;target&lt;/tt&gt;, &lt;tt&gt;format&lt;/tt&gt;) on the currently set context.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#deleteTexture(int)&quot;&gt;&lt;tt&gt;deleteTexture&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int bindTexture(com.trolltech.qt.gui.QImage image, int target)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#bindTexture(com.trolltech.qt.gui.QImage, int, int)&quot;&gt;&lt;tt&gt;bindTexture&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;image&lt;/tt&gt;, &lt;tt&gt;target&lt;/tt&gt;, GL_RGBA). */"/>
    <method name="public final int bindTexture(com.trolltech.qt.gui.QImage image)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#bindTexture(com.trolltech.qt.gui.QImage, int, int)&quot;&gt;&lt;tt&gt;bindTexture&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;image&lt;/tt&gt;, GL_TEXTURE_2D, GL_RGBA). */"/>
    <method name="public final com.trolltech.qt.opengl.QGLColormap colormap()" doc="/**
&lt;p&gt;Returns the colormap for this widget.&lt;/p&gt;
&lt;p&gt;Usually it is only top-level widgets that can have different colormaps installed. Asking for the colormap of a child widget will return the colormap for the child's top-level widget.&lt;/p&gt;
&lt;p&gt;If no colormap has been set for this widget, the &lt;a href=&quot;%2E%2E/gui/QColormap.html&quot;&gt;&lt;tt&gt;QColormap&lt;/tt&gt;&lt;/a&gt; returned will be empty.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#setColormap(com.trolltech.qt.opengl.QGLColormap)&quot;&gt;&lt;tt&gt;setColormap&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.opengl.QGLContext context()" doc="/**
&lt;p&gt;Returns the context of this widget.&lt;/p&gt;
&lt;p&gt;It is possible that the context is not valid (see &lt;a href=&quot;QGLWidget.html#isValid()&quot;&gt;&lt;tt&gt;isValid&lt;/tt&gt;&lt;/a&gt;), for example, if the underlying hardware does not support the format attributes that were requested.&lt;/p&gt;
 */"/>
    <method name="public final void deleteTexture(int tx_id)" doc="/**
&lt;p&gt;Calls QGLContext::deleteTexture(&lt;tt&gt;tx_id&lt;/tt&gt;) on the currently set context.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#bindTexture(com.trolltech.qt.gui.QImage, int, int)&quot;&gt;&lt;tt&gt;bindTexture&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void doneCurrent()" doc="/**
&lt;p&gt;Makes no GL context the current context. Normally, you do not need to call this function; &lt;a href=&quot;QGLContext.html&quot;&gt;&lt;tt&gt;QGLContext&lt;/tt&gt;&lt;/a&gt; calls it as necessary. However, it may be useful in multithreaded environments.&lt;/p&gt;
 */"/>
    <method name="public final boolean doubleBuffer()" doc="/**
&lt;p&gt;Returns true if the contained GL rendering context has double buffering; otherwise returns false.&lt;/p&gt;

@see &lt;tt&gt;QGLFormat::doubleBuffer&lt;/tt&gt; */"/>
    <method name="public final com.trolltech.qt.opengl.QGLFormat format()" doc="/**
&lt;p&gt;Returns the format of the contained GL rendering context.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QImage grabFrameBuffer(boolean withAlpha)" doc="/**
&lt;p&gt;Returns an image of the frame buffer. If &lt;tt&gt;withAlpha&lt;/tt&gt; is true the alpha channel is included.&lt;/p&gt;
&lt;p&gt;Depending on your hardware, you can explicitly select which color buffer to grab with a glReadBuffer() call before calling this function.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QImage grabFrameBuffer()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#grabFrameBuffer(boolean)&quot;&gt;&lt;tt&gt;grabFrameBuffer&lt;/tt&gt;&lt;/a&gt;(false). */"/>
    <method name="public final boolean isSharing()" doc="/**
&lt;p&gt;Returns true if this widget's GL context is shared with another GL context, otherwise false is returned. The GL system may fail to provide context sharing if the two QGLWidgets use different formats.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#format()&quot;&gt;&lt;tt&gt;format&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean isValid()" doc="/**
&lt;p&gt;Returns true if the widget has a valid GL rendering context; otherwise returns false. A widget will be invalid if the system has no OpenGL support&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public final void makeCurrent()" doc="/**
&lt;p&gt;Makes this widget the current widget for OpenGL operations, i.e&amp;#x2e; makes the widget's rendering context the current OpenGL rendering context.&lt;/p&gt;
 */"/>
    <method name="public final void makeOverlayCurrent()" doc="/**
&lt;p&gt;Makes the overlay context of this widget current. Use this if you need to issue OpenGL commands to the overlay context outside of &lt;a href=&quot;QGLWidget.html#initializeOverlayGL()&quot;&gt;&lt;tt&gt;initializeOverlayGL&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QGLWidget.html#resizeOverlayGL(int, int)&quot;&gt;&lt;tt&gt;resizeOverlayGL&lt;/tt&gt;&lt;/a&gt;, and &lt;a href=&quot;QGLWidget.html#paintOverlayGL()&quot;&gt;&lt;tt&gt;paintOverlayGL&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Does nothing if this widget has no overlay.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#makeCurrent()&quot;&gt;&lt;tt&gt;makeCurrent&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.opengl.QGLContext overlayContext()" doc="/**
&lt;p&gt;Returns the overlay context of this widget, or 0 if this widget has no overlay.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#context()&quot;&gt;&lt;tt&gt;context&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void qglClearColor(com.trolltech.qt.gui.QColor c)" doc="/**
&lt;p&gt;Convenience function for specifying the clearing color to OpenGL. Calls glClearColor (in RGBA mode) or glClearIndex (in color-index mode) with the color &lt;tt&gt;c&lt;/tt&gt;. Applies to this widgets GL context.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#qglColor(com.trolltech.qt.gui.QColor)&quot;&gt;&lt;tt&gt;qglColor&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;QGLContext::currentContext&lt;/tt&gt;
@see &lt;a href=&quot;%2E%2E/gui/QColor.html&quot;&gt;&lt;tt&gt;QColor&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void qglColor(com.trolltech.qt.gui.QColor c)" doc="/**
&lt;p&gt;Convenience function for specifying a drawing color to OpenGL. Calls glColor4 (in RGBA mode) or glIndex (in color-index mode) with the color &lt;tt&gt;c&lt;/tt&gt;. Applies to this widgets GL context.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#qglClearColor(com.trolltech.qt.gui.QColor)&quot;&gt;&lt;tt&gt;qglClearColor&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;QGLContext::currentContext&lt;/tt&gt;
@see &lt;a href=&quot;%2E%2E/gui/QColor.html&quot;&gt;&lt;tt&gt;QColor&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QPixmap renderPixmap(int w, int h, boolean useContext)" doc="/**
&lt;p&gt;Renders the current scene on a pixmap and returns the pixmap.&lt;/p&gt;
&lt;p&gt;You can use this method on both visible and invisible QGLWidgets.&lt;/p&gt;
&lt;p&gt;This method will create a pixmap and a temporary &lt;a href=&quot;QGLContext.html&quot;&gt;&lt;tt&gt;QGLContext&lt;/tt&gt;&lt;/a&gt; to render on the pixmap. It will then call &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QGLWidget.html#resizeGL(int, int)&quot;&gt;&lt;tt&gt;resizeGL&lt;/tt&gt;&lt;/a&gt;, and &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; on this context. Finally, the widget's original GL context is restored.&lt;/p&gt;
&lt;p&gt;The size of the pixmap will be &lt;tt&gt;w&lt;/tt&gt; pixels wide and &lt;tt&gt;h&lt;/tt&gt; pixels high unless one of these parameters is 0 (the default), in which case the pixmap will have the same size as the widget.&lt;/p&gt;
&lt;p&gt;If &lt;tt&gt;useContext&lt;/tt&gt; is true, this method will try to be more efficient by using the existing GL context to render the pixmap. The default is false. Only use true if you understand the risks. Note that under Windows a temporary context has to be created and usage of the &lt;i&gt;useContext&lt;/i&gt; parameter is not supported.&lt;/p&gt;
&lt;p&gt;Overlays are not rendered onto the pixmap.&lt;/p&gt;
&lt;p&gt;If the GL rendering context and the desktop have different bit depths, the result will most likely look surprising.&lt;/p&gt;
&lt;p&gt;Note that the creation of display lists, modifications of the view frustum etc. should be done from within &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt;. If this is not done, the temporary &lt;a href=&quot;QGLContext.html&quot;&gt;&lt;tt&gt;QGLContext&lt;/tt&gt;&lt;/a&gt; will not be initialized properly, and the rendered pixmap may be incomplete/corrupted.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QPixmap renderPixmap(int w, int h)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#renderPixmap(int, int, boolean)&quot;&gt;&lt;tt&gt;renderPixmap&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;w&lt;/tt&gt;, &lt;tt&gt;h&lt;/tt&gt;, false). */"/>
    <method name="public final com.trolltech.qt.gui.QPixmap renderPixmap(int w)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#renderPixmap(int, int, boolean)&quot;&gt;&lt;tt&gt;renderPixmap&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;w&lt;/tt&gt;, 0, false). */"/>
    <method name="public final com.trolltech.qt.gui.QPixmap renderPixmap()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#renderPixmap(int, int, boolean)&quot;&gt;&lt;tt&gt;renderPixmap&lt;/tt&gt;&lt;/a&gt;(0, 0, false). */"/>
    <method name="public final void renderText(double x, double y, double z, java.lang.String str, com.trolltech.qt.gui.QFont fnt, int listBase)" doc="/**
&lt;p&gt;&lt;tt&gt;x&lt;/tt&gt;, &lt;tt&gt;y&lt;/tt&gt; and &lt;tt&gt;z&lt;/tt&gt; are specified in scene or object coordinates relative to the currently set projection and model matrices. This can be useful if you want to annotate models with text labels and have the labels move with the model as it is rotated etc.&lt;/p&gt;
&lt;p&gt;Note that this function only works properly if &lt;tt&gt;GL_DEPTH_TEST&lt;/tt&gt; is enabled, and you have a properly initialized depth buffer.&lt;/p&gt;
 */"/>
    <method name="public final void renderText(double x, double y, double z, java.lang.String str, com.trolltech.qt.gui.QFont fnt)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#renderText(int, int, java.lang.String, com.trolltech.qt.gui.QFont, int)&quot;&gt;&lt;tt&gt;renderText&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;x&lt;/tt&gt;, &lt;tt&gt;y&lt;/tt&gt;, &lt;tt&gt;z&lt;/tt&gt;, &lt;tt&gt;str&lt;/tt&gt;, &lt;tt&gt;fnt&lt;/tt&gt;, 2000). */"/>
    <method name="public final void renderText(double x, double y, double z, java.lang.String str)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#renderText(int, int, java.lang.String, com.trolltech.qt.gui.QFont, int)&quot;&gt;&lt;tt&gt;renderText&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;x&lt;/tt&gt;, &lt;tt&gt;y&lt;/tt&gt;, &lt;tt&gt;z&lt;/tt&gt;, &lt;tt&gt;str&lt;/tt&gt;, QFont(), 2000). */"/>
    <method name="public final void renderText(int x, int y, java.lang.String str, com.trolltech.qt.gui.QFont fnt, int listBase)" doc="/**
&lt;p&gt;Renders the string &lt;tt&gt;str&lt;/tt&gt; into the GL context of this widget.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;x&lt;/tt&gt; and &lt;tt&gt;y&lt;/tt&gt; are specified in window coordinates, with the origin in the upper left-hand corner of the window. If &lt;tt&gt;fnt&lt;/tt&gt; is not specified, the currently set application font will be used to render the string. To change the color of the rendered text you can use the glColor() call (or the &lt;a href=&quot;QGLWidget.html#qglColor(com.trolltech.qt.gui.QColor)&quot;&gt;&lt;tt&gt;qglColor&lt;/tt&gt;&lt;/a&gt; convenience function), just before the &lt;a href=&quot;QGLWidget.html#renderText(int, int, java.lang.String, com.trolltech.qt.gui.QFont, int)&quot;&gt;&lt;tt&gt;renderText&lt;/tt&gt;&lt;/a&gt; call.&lt;/p&gt;
&lt;p&gt;The &lt;tt&gt;listBase&lt;/tt&gt; parameter is obsolete and will be removed in a future version of Qt.&lt;/p&gt;
 */"/>
    <method name="public final void renderText(int x, int y, java.lang.String str, com.trolltech.qt.gui.QFont fnt)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#renderText(int, int, java.lang.String, com.trolltech.qt.gui.QFont, int)&quot;&gt;&lt;tt&gt;renderText&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;x&lt;/tt&gt;, &lt;tt&gt;y&lt;/tt&gt;, &lt;tt&gt;str&lt;/tt&gt;, &lt;tt&gt;fnt&lt;/tt&gt;, 2000). */"/>
    <method name="public final void renderText(int x, int y, java.lang.String str)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QGLWidget.html#renderText(int, int, java.lang.String, com.trolltech.qt.gui.QFont, int)&quot;&gt;&lt;tt&gt;renderText&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;x&lt;/tt&gt;, &lt;tt&gt;y&lt;/tt&gt;, &lt;tt&gt;str&lt;/tt&gt;, QFont(), 2000). */"/>
    <method name="protected final void setAutoBufferSwap(boolean on)" doc="/**
&lt;p&gt;If &lt;tt&gt;on&lt;/tt&gt; is true automatic GL buffer swapping is switched on; otherwise it is switched off.&lt;/p&gt;
&lt;p&gt;If &lt;tt&gt;on&lt;/tt&gt; is true and the widget is using a double-buffered format, the background and foreground GL buffers will automatically be swapped after each &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; call.&lt;/p&gt;
&lt;p&gt;The buffer auto-swapping is on by default.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#autoBufferSwap()&quot;&gt;&lt;tt&gt;autoBufferSwap&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QGLWidget.html#doubleBuffer()&quot;&gt;&lt;tt&gt;doubleBuffer&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QGLWidget.html#swapBuffers()&quot;&gt;&lt;tt&gt;swapBuffers&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setColormap(com.trolltech.qt.opengl.QGLColormap map)" doc="/**
&lt;p&gt;Set the colormap for this widget to &lt;tt&gt;map&lt;/tt&gt;. Usually it is only top-level widgets that can have colormaps installed.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#colormap()&quot;&gt;&lt;tt&gt;colormap&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void swapBuffers()" doc="/**
&lt;p&gt;Swaps the screen contents with an off-screen buffer. This only works if the widget's format specifies double buffer mode.&lt;/p&gt;
&lt;p&gt;Normally, there is no need to explicitly call this function because it is done automatically after each widget repaint, i.e&amp;#x2e; each time after &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; has been executed.&lt;/p&gt;

@see &lt;a href=&quot;QGLWidget.html#doubleBuffer()&quot;&gt;&lt;tt&gt;doubleBuffer&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QGLWidget.html#setAutoBufferSwap(boolean)&quot;&gt;&lt;tt&gt;setAutoBufferSwap&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;QGLFormat::setDoubleBuffer&lt;/tt&gt; */"/>
    <method name="public boolean event(com.trolltech.qt.core.QEvent arg__1)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="protected void glDraw()" doc="/**
&lt;p&gt;Executes the virtual function &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The widget's rendering context will become the current context and &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt; will be called if it hasn't already been called.&lt;/p&gt;
 */"/>
    <method name="protected void glInit()" doc="/**
&lt;p&gt;Initializes OpenGL for this widget's context. Calls the virtual function &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
    <method name="protected void initializeGL()" doc="/**
&lt;p&gt;This virtual function is called once before the first call to &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;QGLWidget.html#resizeGL(int, int)&quot;&gt;&lt;tt&gt;resizeGL&lt;/tt&gt;&lt;/a&gt;, and then once whenever the widget has been assigned a new &lt;a href=&quot;QGLContext.html&quot;&gt;&lt;tt&gt;QGLContext&lt;/tt&gt;&lt;/a&gt;. Reimplement it in a subclass.&lt;/p&gt;
&lt;p&gt;This function should set up any required OpenGL context rendering flags, defining display lists, etc.&lt;/p&gt;
&lt;p&gt;There is no need to call &lt;a href=&quot;QGLWidget.html#makeCurrent()&quot;&gt;&lt;tt&gt;makeCurrent&lt;/tt&gt;&lt;/a&gt; because this has already been done when this function is called.&lt;/p&gt;
 */"/>
    <method name="protected void initializeOverlayGL()" doc="/**
&lt;p&gt;This virtual function is used in the same manner as &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt; except that it operates on the widget's overlay context instead of the widget's main context. This means that &lt;a href=&quot;QGLWidget.html#initializeOverlayGL()&quot;&gt;&lt;tt&gt;initializeOverlayGL&lt;/tt&gt;&lt;/a&gt; is called once before the first call to &lt;a href=&quot;QGLWidget.html#paintOverlayGL()&quot;&gt;&lt;tt&gt;paintOverlayGL&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;QGLWidget.html#resizeOverlayGL(int, int)&quot;&gt;&lt;tt&gt;resizeOverlayGL&lt;/tt&gt;&lt;/a&gt;. Reimplement it in a subclass.&lt;/p&gt;
&lt;p&gt;This function should set up any required OpenGL context rendering flags, defining display lists, etc. for the overlay context.&lt;/p&gt;
&lt;p&gt;There is no need to call &lt;a href=&quot;QGLWidget.html#makeOverlayCurrent()&quot;&gt;&lt;tt&gt;makeOverlayCurrent&lt;/tt&gt;&lt;/a&gt; because this has already been done when this function is called.&lt;/p&gt;
 */"/>
    <method name="public com.trolltech.qt.gui.QPaintEngine paintEngine()" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="protected void paintEvent(com.trolltech.qt.gui.QPaintEvent arg__1)" doc="/**
&lt;p&gt;Handles paint events passed in the &lt;tt&gt;arg__1&lt;/tt&gt; parameter. Will cause the virtual &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; function to be called.&lt;/p&gt;
&lt;p&gt;The widget's rendering context will become the current context and &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt; will be called if it hasn't already been called.&lt;/p&gt;
 */"/>
    <method name="protected void paintGL()" doc="/**
&lt;p&gt;This virtual function is called whenever the widget needs to be painted. Reimplement it in a subclass.&lt;/p&gt;
&lt;p&gt;There is no need to call &lt;a href=&quot;QGLWidget.html#makeCurrent()&quot;&gt;&lt;tt&gt;makeCurrent&lt;/tt&gt;&lt;/a&gt; because this has already been done when this function is called.&lt;/p&gt;
 */"/>
    <method name="protected void paintOverlayGL()" doc="/**
&lt;p&gt;This virtual function is used in the same manner as &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; except that it operates on the widget's overlay context instead of the widget's main context. This means that &lt;a href=&quot;QGLWidget.html#paintOverlayGL()&quot;&gt;&lt;tt&gt;paintOverlayGL&lt;/tt&gt;&lt;/a&gt; is called whenever the widget's overlay needs to be painted. Reimplement it in a subclass.&lt;/p&gt;
&lt;p&gt;There is no need to call &lt;a href=&quot;QGLWidget.html#makeOverlayCurrent()&quot;&gt;&lt;tt&gt;makeOverlayCurrent&lt;/tt&gt;&lt;/a&gt; because this has already been done when this function is called.&lt;/p&gt;
 */"/>
    <method name="protected void resizeEvent(com.trolltech.qt.gui.QResizeEvent arg__1)" doc="/**
&lt;p&gt;Handles resize events that are passed in the &lt;tt&gt;arg__1&lt;/tt&gt; parameter. Calls the virtual function &lt;a href=&quot;QGLWidget.html#resizeGL(int, int)&quot;&gt;&lt;tt&gt;resizeGL&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
    <method name="protected void resizeGL(int w, int h)" doc="/**
&lt;p&gt;This virtual function is called whenever the widget has been resized. The new size is passed in &lt;tt&gt;w&lt;/tt&gt; and &lt;tt&gt;h&lt;/tt&gt;. Reimplement it in a subclass.&lt;/p&gt;
&lt;p&gt;There is no need to call &lt;a href=&quot;QGLWidget.html#makeCurrent()&quot;&gt;&lt;tt&gt;makeCurrent&lt;/tt&gt;&lt;/a&gt; because this has already been done when this function is called.&lt;/p&gt;
 */"/>
    <method name="protected void resizeOverlayGL(int w, int h)" doc="/**
&lt;p&gt;This virtual function is used in the same manner as &lt;a href=&quot;QGLWidget.html#paintGL()&quot;&gt;&lt;tt&gt;paintGL&lt;/tt&gt;&lt;/a&gt; except that it operates on the widget's overlay context instead of the widget's main context. This means that &lt;a href=&quot;QGLWidget.html#resizeOverlayGL(int, int)&quot;&gt;&lt;tt&gt;resizeOverlayGL&lt;/tt&gt;&lt;/a&gt; is called whenever the widget has been resized. The new size is passed in &lt;tt&gt;w&lt;/tt&gt; and &lt;tt&gt;h&lt;/tt&gt;. Reimplement it in a subclass.&lt;/p&gt;
&lt;p&gt;There is no need to call &lt;a href=&quot;QGLWidget.html#makeOverlayCurrent()&quot;&gt;&lt;tt&gt;makeOverlayCurrent&lt;/tt&gt;&lt;/a&gt; because this has already been done when this function is called.&lt;/p&gt;
 */"/>
    <method name="public void updateGL()" doc="/**
&lt;p&gt;Updates the widget by calling &lt;a href=&quot;QGLWidget.html#glDraw()&quot;&gt;&lt;tt&gt;glDraw&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
    <method name="public void updateOverlayGL()" doc="/**
&lt;p&gt;Updates the widget's overlay (if any). Will cause the virtual function &lt;a href=&quot;QGLWidget.html#paintOverlayGL()&quot;&gt;&lt;tt&gt;paintOverlayGL&lt;/tt&gt;&lt;/a&gt; to be executed.&lt;/p&gt;
&lt;p&gt;The widget's rendering context will become the current context and &lt;a href=&quot;QGLWidget.html#initializeGL()&quot;&gt;&lt;tt&gt;initializeGL&lt;/tt&gt;&lt;/a&gt; will be called if it hasn't already been called.&lt;/p&gt;
 */"/>
    <method name="public static com.trolltech.qt.gui.QImage convertToGLFormat(com.trolltech.qt.gui.QImage img)" doc="/**
&lt;p&gt;Converts the image &lt;tt&gt;img&lt;/tt&gt; into the unnamed format expected by OpenGL functions such as glTexImage2D(). The returned image is not usable as a &lt;a href=&quot;%2E%2E/gui/QImage.html&quot;&gt;&lt;tt&gt;QImage&lt;/tt&gt;&lt;/a&gt;, but QImage::width(), QImage::height() and QImage::bits() may be used with OpenGL.&lt;/p&gt;
 */"/>
</class>