QGLWidget Class Reference

The QGLWidget class is a widget for rendering OpenGL graphics.

  1. #include <QGLWidget>

Inherits: QWidget.

Detailed Description

The QGLWidget class is a widget for rendering OpenGL graphics.

QGLWidget 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 QWidget, except that you have the choice between using QPainter and standard OpenGL rendering commands.

QGLWidget provides three convenient virtual functions that you can reimplement in your subclass to perform the typical OpenGL tasks:

  • paintGL() - Renders the OpenGL scene. Gets called whenever the widget needs to be updated.
  • resizeGL() - Sets up the OpenGL viewport, projection, etc. Gets called whenever 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).
  • initializeGL() - Sets up the OpenGL rendering context, defines display lists, etc. Gets called once before the first time resizeGL() or paintGL() is called.

Here is a rough outline of how a QGLWidget subclass might look:

  1. class MyGLDrawer : public QGLWidget
  2.  {
  3.     Q_OBJECT        // must include this if you use Qt signals/slots
  4.  
  5. public:
  6.     MyGLDrawer(QWidget *parent)
  7.         : QGLWidget(parent)  {}
  8.  
  9. protected:
  10.  
  11.     void initializeGL()
  12.      {
  13.         // Set up the rendering context, define display lists etc.:
  14.         ...
  15.         glClearColor(0.0, 0.0, 0.0, 0.0);
  16.         glEnable(GL_DEPTH_TEST);
  17.         ...
  18.     }
  19.  
  20.     void resizeGL(int w, int h)
  21.      {
  22.         // setup viewport, projection etc.:
  23.         glViewport(0, 0, (GLint)w, (GLint)h);
  24.         ...
  25.         glFrustum(...);
  26.         ...
  27.     }
  28.  
  29.     void paintGL()
  30.      {
  31.         // draw the scene:
  32.         ...
  33.         glRotatef(...);
  34.         glMaterialfv(...);
  35.         glBegin(GL_QUADS);
  36.         glVertex3f(...);
  37.         glVertex3f(...);
  38.         ...
  39.         glEnd();
  40.         ...
  41.     }
  42.  
  43. };

If you need to trigger a repaint from places other than paintGL() (a typical example is when using timers to animate scenes), you should call the widget's updateGL() function.

Your widget's OpenGL rendering context is made current when paintGL(), resizeGL(), or initializeGL() is called. If you need to call the standard OpenGL API functions from other places (e.g. in your widget's constructor or in your own paint functions), you must call makeCurrent() first.

QGLWidget provides functions for requesting a new display format and you can also create widgets with customized rendering contexts.

You can also share OpenGL display lists between QGLWidget objects (see the documentation of the QGLWidget constructors for details).

Note that under Windows, the QGLContext belonging to a QGLWidget has to be recreated when the QGLWidget is reparented. This is necessary due to limitations on the Windows platform. This will most likely cause problems for users that have subclassed and installed their own QGLContext on a QGLWidget. It is possible to work around this issue by putting the QGLWidget inside a dummy widget and then reparenting the dummy widget, instead of the QGLWidget. This will side-step the issue altogether, and is what we recommend for users that need this kind of functionality.

On Mac OS X, when Qt is built with Cocoa support, a QGLWidget can't have any sibling widgets placed ontop of itself. This is due to limitations in the Cocoa API and is not supported by Apple.

Overlays

The QGLWidget creates a GL overlay context in addition to the normal context if overlays are supported by the underlying system.

If you want to use overlays, you specify it in the format. (Note: Overlay must be requested in the format passed to the QGLWidget constructor.) Your GL widget should also implement some or all of these virtual methods:

These methods work in the same way as the normal paintGL() 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 makeOverlayCurrent(), and you can access the overlay context directly (e.g. to ask for its transparent color) by calling overlayContext().

On X servers in which the default visual is in an overlay plane, non-GL Qt windows can also be used for overlays.

Painting Techniques

As described above, subclass QGLWidget to render pure 3D content in the following way:

It is also possible to draw 2D graphics onto a QGLWidget subclass, it is necessary to reimplement QGLWidget::paintEvent() and do the following:

Overpainting 2D content on top of 3D content takes a little more effort. One approach to doing this is shown in the Overpainting example.

Threading

It is possible to render into a QGLWidget from another thread, but it requires that all access to the GL context is safe guarded. The Qt GUI thread will try to use the context in resizeEvent and paintEvent, so in order for threaded rendering using a GL widget to work, these functions need to be intercepted in the GUI thread and handled accordingly in the application.

OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.

See also QGLPixelBuffer, Hello GL Example, 2D Painting Example, Overpainting Example, and Grabber Example.

Public Functions

Toggle details QGLWidget

QGLWidgetQGLWidget ( QWidget *parent=0 , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 ...) ( QWidget *parent=0 , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 )

Constructs an OpenGL widget with a parent widget.

The default format is used. The widget will be invalid if the system has no OpenGL support.

The parent and widget flag, f, arguments are passed to the QWidget constructor.

If shareWidget is a valid QGLWidget, this widget will share OpenGL display lists and texture objects with shareWidget. But if shareWidget and this widget have different formats, sharing might not be possible. You can check whether sharing is in effect by calling isSharing().

The initialization of OpenGL rendering state, etc. should be done by overriding the initializeGL() function, rather than in the constructor of your QGLWidget subclass.

See also QGLFormat::defaultFormat() and Textures Example.

Look up this member in the source code.

Toggle details QGLWidget

QGLWidgetQGLWidget ( QGLContext *context , QWidget *parent=0 , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 ...) ( QGLContext *context , QWidget *parent=0 , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 )

Constructs an OpenGL widget with parent parent.

The context argument is a pointer to the QGLContext that you wish to be bound to this widget. This allows you to pass in your own QGLContext sub-classes.

The widget will be invalid if the system has no OpenGL support.

The parent and widget flag, f, arguments are passed to the QWidget constructor.

If shareWidget is a valid QGLWidget, this widget will share OpenGL display lists and texture objects with shareWidget. But if shareWidget and this widget have different formats, sharing might not be possible. You can check whether sharing is in effect by calling isSharing().

The initialization of OpenGL rendering state, etc. should be done by overriding the initializeGL() function, rather than in the constructor of your QGLWidget subclass.

See also QGLFormat::defaultFormat() and isValid().

Look up this member in the source code.

Toggle details QGLWidget

QGLWidgetQGLWidget ( const QGLFormat &format , QWidget *parent=0 , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 ...) ( const QGLFormat &format , QWidget *parent=0 , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 )

Constructs an OpenGL widget with parent parent.

The format argument specifies the desired rendering options. If the underlying OpenGL/Window system cannot satisfy all the features requested in format, the nearest subset of features will be used. After creation, the format() method will return the actual format obtained.

The widget will be invalid if the system has no OpenGL support.

The parent and widget flag, f, arguments are passed to the QWidget constructor.

If shareWidget is a valid QGLWidget, this widget will share OpenGL display lists and texture objects with shareWidget. But if shareWidget and this widget have different formats, sharing might not be possible. You can check whether sharing is in effect by calling isSharing().

The initialization of OpenGL rendering state, etc. should be done by overriding the initializeGL() function, rather than in the constructor of your QGLWidget subclass.

See also QGLFormat::defaultFormat() and isValid().

Look up this member in the source code.

Toggle details QGLWidget

~QGLWidget~QGLWidget () ()

Destroys the widget.

Look up this member in the source code.

Toggle details bool QGLWidget

autoBufferSwapautoBufferSwap () ()const[protected]

Returns true if the widget is doing automatic GL buffer swapping; otherwise returns false.

See also setAutoBufferSwap().

Look up this member in the source code.

Toggle details GLuint QGLWidget

bindTexturebindTexture ( const QImage &image , GLenumtarget=GL_TEXTURE_2D , GLintformat=GL_RGBA ...) ( const QImage &image , GLenumtarget=GL_TEXTURE_2D , GLintformat=GL_RGBA )

Calls QGLContext:::bindTexture(image, target, format) on the currently set context.

See also deleteTexture().

Look up this member in the source code.

Toggle details GLuint QGLWidget

bindTexturebindTexture ( const QPixmap &pixmap , GLenumtarget=GL_TEXTURE_2D , GLintformat=GL_RGBA ...) ( const QPixmap &pixmap , GLenumtarget=GL_TEXTURE_2D , GLintformat=GL_RGBA )

Calls QGLContext:::bindTexture(pixmap, target, format) on the currently set context.

See also deleteTexture().

Look up this member in the source code.

Toggle details GLuint QGLWidget

bindTexturebindTexture ( const QImage &image , GLenumtarget , GLintformat , QGLContext::BindOptions options ...) ( const QImage &image , GLenumtarget , GLintformat , QGLContext::BindOptions options )

This is an overloaded function.

The binding options are a set of options used to decide how to bind the texture to the context.

Look up this member in the source code.

Toggle details GLuint QGLWidget

bindTexturebindTexture ( const QPixmap &pixmap , GLenumtarget , GLintformat , QGLContext::BindOptions options ...) ( const QPixmap &pixmap , GLenumtarget , GLintformat , QGLContext::BindOptions options )

This is an overloaded function.

Generates and binds a 2D GL texture to the current context, based on pixmap. The generated texture id is returned and can be used in

The binding options are a set of options used to decide how to bind the texture to the context.

Look up this member in the source code.

Toggle details GLuint QGLWidget

bindTexturebindTexture ( const QString &fileName ) ( const QString &fileName )

This is an overloaded function.

Calls QGLContext::bindTexture(fileName) on the currently set context.

See also deleteTexture().

Look up this member in the source code.

Toggle details const QGLColormap & QGLWidget

colormapcolormap () ()const

Returns the colormap for this widget.

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.

If no colormap has been set for this widget, the QGLColormap returned will be empty.

See also setColormap() and QGLColormap::isEmpty().

Look up this member in the source code.

Toggle details const QGLContext * QGLWidget

contextcontext () ()const

Returns the context of this widget.

It is possible that the context is not valid (see isValid()), for example, if the underlying hardware does not support the format attributes that were requested.

Look up this member in the source code.

Toggle details QImage QGLWidget

convertToGLFormatconvertToGLFormat ( const QImage &img ) ( const QImage &img ) [static]

Converts the image img into the unnamed format expected by OpenGL functions such as glTexImage2D(). The returned image is not usable as a QImage, but QImage::width(), QImage::height() and QImage::bits() may be used with OpenGL. The GL format used is GL_RGBA.

Look up this member in the source code.

Toggle details void QGLWidget

deleteTexturedeleteTexture ( GLuintid ) ( GLuintid )

Calls QGLContext::deleteTexture(id) on the currently set context.

See also bindTexture().

Look up this member in the source code.

Toggle details void QGLWidget

doneCurrentdoneCurrent () ()

Makes no GL context the current context. Normally, you do not need to call this function; QGLContext calls it as necessary. However, it may be useful in multithreaded environments.

Look up this member in the source code.

Toggle details bool QGLWidget

doubleBufferdoubleBuffer () ()const

Returns true if the contained GL rendering context has double buffering; otherwise returns false.

See also QGLFormat::doubleBuffer().

Look up this member in the source code.

Toggle details void QGLWidget

drawTexturedrawTexture ( const QRectF &target , GLuinttextureId , GLenumtextureTarget=GL_TEXTURE_2D ...) ( const QRectF &target , GLuinttextureId , GLenumtextureTarget=GL_TEXTURE_2D )

Calls the corresponding QGLContext::drawTexture() with target, textureId, and textureTarget for this widget's context.

Look up this member in the source code.

Toggle details void QGLWidget

drawTexturedrawTexture ( const QPointF &point , GLuinttextureId , GLenumtextureTarget=GL_TEXTURE_2D ...) ( const QPointF &point , GLuinttextureId , GLenumtextureTarget=GL_TEXTURE_2D )

Calls the corresponding QGLContext::drawTexture() with point, textureId, and textureTarget for this widget's context.

Look up this member in the source code.

Toggle details bool QGLWidget

eventevent ( QEvent *e ) ( QEvent *e ) [virtual protected]

Reimplemented from QObject::event().

Look up this member in the source code.

Toggle details QGLFormat QGLWidget

formatformat () ()const

Returns the format of the contained GL rendering context.

See also setFormat().

Look up this member in the source code.

Toggle details void QGLWidget

glDrawglDraw () () [virtual protected]

Executes the virtual function paintGL().

The widget's rendering context will become the current context and initializeGL() will be called if it hasn't already been called.

Look up this member in the source code.

Toggle details void QGLWidget

glInitglInit () () [virtual protected]

Initializes OpenGL for this widget's context. Calls the virtual function initializeGL().

Look up this member in the source code.

Toggle details QImage QGLWidget

grabFrameBuffergrabFrameBuffer ( bool withAlpha=false ) ( bool withAlpha=false )

Returns an image of the frame buffer. If withAlpha is true the alpha channel is included.

Depending on your hardware, you can explicitly select which color buffer to grab with a glReadBuffer() call before calling this function.

Look up this member in the source code.

Toggle details void QGLWidget

initializeGLinitializeGL () () [virtual protected]

This virtual function is called once before the first call to paintGL() or resizeGL(), and then once whenever the widget has been assigned a new QGLContext. Reimplement it in a subclass.

This function should set up any required OpenGL context rendering flags, defining display lists, etc.

There is no need to call makeCurrent() because this has already been done when this function is called.

Look up this member in the source code.

Toggle details void QGLWidget

initializeOverlayGLinitializeOverlayGL () () [virtual protected]

This virtual function is used in the same manner as initializeGL() except that it operates on the widget's overlay context instead of the widget's main context. This means that initializeOverlayGL() is called once before the first call to paintOverlayGL() or resizeOverlayGL(). Reimplement it in a subclass.

This function should set up any required OpenGL context rendering flags, defining display lists, etc. for the overlay context.

There is no need to call makeOverlayCurrent() because this has already been done when this function is called.

Look up this member in the source code.

Toggle details bool QGLWidget

isSharingisSharing () ()const

Returns true if this widget's GL context is shared with another GL context, otherwise false is returned. Context sharing might not be possible if the widgets use different formats.

See also format().

Look up this member in the source code.

Toggle details bool QGLWidget

isValidisValid () ()const

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.

Look up this member in the source code.

Toggle details void QGLWidget

makeCurrentmakeCurrent () ()

Makes this widget the current widget for OpenGL operations, i.e. makes the widget's rendering context the current OpenGL rendering context.

Look up this member in the source code.

Toggle details void QGLWidget

makeOverlayCurrentmakeOverlayCurrent () ()

Makes the overlay context of this widget current. Use this if you need to issue OpenGL commands to the overlay context outside of initializeOverlayGL(), resizeOverlayGL(), and paintOverlayGL().

Does nothing if this widget has no overlay.

See also makeCurrent().

Look up this member in the source code.

Toggle details const QGLContext * QGLWidget

overlayContextoverlayContext () ()const

Returns the overlay context of this widget, or 0 if this widget has no overlay.

See also context().

Look up this member in the source code.

Toggle details void QGLWidget

paintEventpaintEvent ( QPaintEvent *event ) ( QPaintEvent *event ) [virtual protected]

Reimplemented from QWidget::paintEvent().

Handles paint events passed in the event parameter. Will cause the virtual paintGL() function to be called.

The widget's rendering context will become the current context and initializeGL() will be called if it hasn't already been called.

Look up this member in the source code.

Toggle details void QGLWidget

paintGLpaintGL () () [virtual protected]

This virtual function is called whenever the widget needs to be painted. Reimplement it in a subclass.

There is no need to call makeCurrent() because this has already been done when this function is called.

Look up this member in the source code.

Toggle details void QGLWidget

paintOverlayGLpaintOverlayGL () () [virtual protected]

This virtual function is used in the same manner as paintGL() except that it operates on the widget's overlay context instead of the widget's main context. This means that paintOverlayGL() is called whenever the widget's overlay needs to be painted. Reimplement it in a subclass.

There is no need to call makeOverlayCurrent() because this has already been done when this function is called.

Look up this member in the source code.

Toggle details void QGLWidget

qglClearColorqglClearColor ( const QColor &c ) ( const QColor &c )const

Convenience function for specifying the clearing color to OpenGL. Calls glClearColor (in RGBA mode) or glClearIndex (in color-index mode) with the color c. Applies to this widgets GL context.

See also qglColor(), QGLContext::currentContext(), and QColor.

Look up this member in the source code.

Toggle details void QGLWidget

qglColorqglColor ( const QColor &c ) ( const QColor &c )const

Convenience function for specifying a drawing color to OpenGL. Calls glColor4 (in RGBA mode) or glIndex (in color-index mode) with the color c. Applies to this widgets GL context.

Note: This function is not supported on OpenGL/ES 2.0 systems.

See also qglClearColor(), QGLContext::currentContext(), and QColor.

Look up this member in the source code.

Toggle details QPixmap QGLWidget

renderPixmaprenderPixmap ( int w=0 , int h=0 , bool useContext=false ...) ( int w=0 , int h=0 , bool useContext=false )

Renders the current scene on a pixmap and returns the pixmap.

You can use this method on both visible and invisible QGLWidget objects.

This method will create a pixmap and a temporary QGLContext to render on the pixmap. It will then call initializeGL(), resizeGL(), and paintGL() on this context. Finally, the widget's original GL context is restored.

The size of the pixmap will be w pixels wide and h pixels high unless one of these parameters is 0 (the default), in which case the pixmap will have the same size as the widget.

If useContext 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 useContext parameter is not supported.

Overlays are not rendered onto the pixmap.

If the GL rendering context and the desktop have different bit depths, the result will most likely look surprising.

Note that the creation of display lists, modifications of the view frustum etc. should be done from within initializeGL(). If this is not done, the temporary QGLContext will not be initialized properly, and the rendered pixmap may be incomplete/corrupted.

Look up this member in the source code.

Toggle details void QGLWidget

renderTextrenderText ( int x , int y , const QString &str , const QFont &font=QFont() , int listBase=2000 ...) ( int x , int y , const QString &str , const QFont &font=QFont() , int listBase=2000 )

Renders the string str into the GL context of this widget.

x and y are specified in window coordinates, with the origin in the upper left-hand corner of the window. If font 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 qglColor() convenience function), just before the renderText() call.

The listBase parameter is obsolete and will be removed in a future version of Qt.

Note: This function clears the stencil buffer.

Note: This function is not supported on OpenGL/ES systems.

Note: This function temporarily disables depth-testing when the text is drawn.

Note: This function can only be used inside a QPainter::beginNativePainting()/QPainter::endNativePainting() block if the default OpenGL paint engine is QPaintEngine::OpenGL. To make QPaintEngine::OpenGL the default GL engine, call QGL::setPreferredPaintEngine(QPaintEngine::OpenGL) before the QApplication constructor.

Overpaint with QPainter::drawText() instead.

Look up this member in the source code.

Toggle details void QGLWidget

renderTextrenderText ( double x , double y , double z , const QString &str , const QFont &font=QFont() , int listBase=2000 ...) ( double x , double y , double z , const QString &str , const QFont &font=QFont() , int listBase=2000 )

This is an overloaded function.

x, y and z 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.

Note: This function is not supported on OpenGL/ES systems.

Note: If depth testing is enabled before this function is called, then the drawn text will be depth-tested against the models that have already been drawn in the scene. Use glDisable(GL_DEPTH_TEST) before calling this function to annotate the models without depth-testing the text.

Overpaint with QPainter::drawText() instead.

Look up this member in the source code.

Toggle details void QGLWidget

resizeEventresizeEvent ( QResizeEvent *event ) ( QResizeEvent *event ) [virtual protected]

Reimplemented from QWidget::resizeEvent().

Handles resize events that are passed in the event parameter. Calls the virtual function resizeGL().

Look up this member in the source code.

Toggle details void QGLWidget

resizeGLresizeGL ( int width , int height ) ( int width , int height ) [virtual protected]

This virtual function is called whenever the widget has been resized. The new size is passed in width and height. Reimplement it in a subclass.

There is no need to call makeCurrent() because this has already been done when this function is called.

Look up this member in the source code.

Toggle details void QGLWidget

resizeOverlayGLresizeOverlayGL ( int width , int height ) ( int width , int height ) [virtual protected]

This virtual function is used in the same manner as paintGL() except that it operates on the widget's overlay context instead of the widget's main context. This means that resizeOverlayGL() is called whenever the widget has been resized. The new size is passed in width and height. Reimplement it in a subclass.

There is no need to call makeOverlayCurrent() because this has already been done when this function is called.

Look up this member in the source code.

Toggle details void QGLWidget

setAutoBufferSwapsetAutoBufferSwap ( bool on ) ( bool on )[protected]

If on is true automatic GL buffer swapping is switched on; otherwise it is switched off.

If on is true and the widget is using a double-buffered format, the background and foreground GL buffers will automatically be swapped after each paintGL() call.

The buffer auto-swapping is on by default.

See also autoBufferSwap(), doubleBuffer(), and swapBuffers().

Look up this member in the source code.

Toggle details void QGLWidget

setColormapsetColormap ( const QGLColormap &cmap ) ( const QGLColormap &cmap )

Set the colormap for this widget to cmap. Usually it is only top-level widgets that can have colormaps installed.

See also colormap().

Look up this member in the source code.

Toggle details void QGLWidget

setMouseTrackingsetMouseTracking ( bool enable ) ( bool enable )

If enable is true then mouse tracking is enabled; otherwise it is disabled.

Look up this member in the source code.

Toggle details void QGLWidget

swapBuffersswapBuffers () ()

Swaps the screen contents with an off-screen buffer. This only works if the widget's format specifies double buffer mode.

Normally, there is no need to explicitly call this function because it is done automatically after each widget repaint, i.e. each time after paintGL() has been executed.

See also doubleBuffer(), setAutoBufferSwap(), and QGLFormat::setDoubleBuffer().

Look up this member in the source code.

Toggle details int QGLWidget

fontDisplayListBasefontDisplayListBase ( const QFont &font , int listBase=2000 ...) ( const QFont &font , int listBase=2000 )[protected] Obsolete function

Returns the value of the first display list that is generated for the characters in the given font. listBase indicates the base value used when generating the display lists for the font. The default value is 2000.

Note: This function is not supported on OpenGL/ES systems.

Look up this member in the source code.

Toggle details void QGLWidget

setFormatsetFormat ( const QGLFormat &format ) ( const QGLFormat &format ) Obsolete function

Sets a new format for this widget.

If the underlying OpenGL/Window system cannot satisfy all the features requested in format, the nearest subset of features will be used. After creation, the format() method will return the actual rendering context format obtained.

The widget will be assigned a new QGLContext, and the initializeGL() function will be executed for this new context before the first resizeGL() or paintGL().

This method will try to keep display list and texture object sharing in effect with other QGLWidget objects, but changing the format might make sharing impossible. Use isSharing() to see if sharing is still in effect.

See also format(), isSharing(), and isValid().

Look up this member in the source code.

Toggle details QGLWidget

QGLWidgetQGLWidget ( QWidget *parent , const char *name , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 ...) ( QWidget *parent , const char *name , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 ) Qt3-support

This is an overloaded function.

Look up this member in the source code.

Toggle details QGLWidget

QGLWidgetQGLWidget ( const QGLFormat &format , QWidget *parent , const char *name , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 ...) ( const QGLFormat &format , QWidget *parent , const char *name , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 ) Qt3-support

This is an overloaded function.

Look up this member in the source code.

Toggle details QGLWidget

QGLWidgetQGLWidget ( QGLContext *context , QWidget *parent , const char *name , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 ...) ( QGLContext *context , QWidget *parent , const char *name , const QGLWidget *shareWidget=0 , Qt::WindowFlags f=0 ) Qt3-support

This is an overloaded function.

Look up this member in the source code.

Public Slots

Toggle details void QGLWidget

updateGLupdateGL () () [virtual] [slot]

Updates the widget by calling glDraw().

Look up this member in the source code.

Toggle details void QGLWidget

updateOverlayGLupdateOverlayGL () () [virtual] [slot]

Updates the widget's overlay (if any). Will cause the virtual function paintOverlayGL() to be executed.

The widget's rendering context will become the current context and initializeGL() will be called if it hasn't already been called.

Look up this member in the source code.

Notes provided by the Qt Community

No notes