QGLFormat Class Reference

The QGLFormat class specifies the display format of an OpenGL rendering context.

  1. #include <QGLFormat>

Detailed Description

The QGLFormat class specifies the display format of an OpenGL rendering context.

A display format has several characteristics:

You can also specify preferred bit depths for the color buffer, depth buffer, alpha buffer, accumulation buffer and the stencil buffer with the functions: setRedBufferSize(), setGreenBufferSize(), setBlueBufferSize(), setDepthBufferSize(), setAlphaBufferSize(), setAccumBufferSize() and setStencilBufferSize().

Note that even if you specify that you prefer a 32 bit depth buffer (e.g. with setDepthBufferSize(32)), the format that is chosen may not have a 32 bit depth buffer, even if there is a format available with a 32 bit depth buffer. The main reason for this is how the system dependant picking algorithms work on the different platforms, and some format options may have higher precedence than others.

You create and tell a QGLFormat object what rendering options you want from an OpenGL rendering context.

OpenGL drivers or accelerated hardware may or may not support advanced features such as alpha channel or stereographic viewing. If you request some features that the driver/hardware does not provide when you create a QGLWidget, you will get a rendering context with the nearest subset of features.

There are different ways to define the display characteristics of a rendering context. One is to create a QGLFormat and make it the default for the entire application:

  1. fmt.setAlpha(true);
  2. fmt.setStereo(true);
  3. QGLFormat::setDefaultFormat(fmt);

Or you can specify the desired format when creating an object of your QGLWidget subclass:

  1. fmt.setDoubleBuffer(false);                 // single buffer
  2. fmt.setDirectRendering(false);              // software rendering
  3. MyGLWidget* myWidget = new MyGLWidget(fmt, ...);

After the widget has been created, you can find out which of the requested features the system was able to provide:

  1. fmt.setOverlay(true);
  2. fmt.setStereo(true);
  3. MyGLWidget* myWidget = new MyGLWidget(fmt, ...);
  4. if (!myWidget->format().stereo())  {
  5.     // ok, goggles off
  6.     if (!myWidget->format().hasOverlay())  {
  7.         qFatal("Cool hardware required");
  8.     }
  9. }

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

See also QGLContext and QGLWidget.

Public Types

Toggle detailsenum QGLFormat::

OpenGLContextProfileOpenGLContextProfile { NoProfile , CoreProfile , CompatibilityProfile 2 ...} { NoProfile , CoreProfile , CompatibilityProfile 2 }

This enum describes the OpenGL context profiles that can be specified for contexts implementing OpenGL version 3.2 or higher. These profiles are different from OpenGL ES profiles.

ConstantValueDescription
QGLFormat::NoProfile 0 OpenGL version is lower than 3.2.
QGLFormat::CoreProfile 1 Functionality deprecated in OpenGL version 3.0 is not available.
QGLFormat::CompatibilityProfile 2 Functionality from earlier OpenGL versions is available.

Look up this member in the source code.

Toggle detailsenum QGLFormat::

OpenGLVersionFlagOpenGLVersionFlag { OpenGL_Version_None , OpenGL_Version_1_1 , OpenGL_Version_1_2 , OpenGL_Version_1_3 , OpenGL_Version_1_4 , OpenGL_Version_1_5 , OpenGL_Version_2_0 , OpenGL_Version_2_1 , OpenGL_ES_Common_Version_1_0 , OpenGL_ES_CommonLite_Version_1_0 , OpenGL_ES_Common_Version_1_1 , OpenGL_ES_CommonLite_Version_1_1 , OpenGL_ES_Version_2_0 , OpenGL_Version_3_0 , OpenGL_Version_3_1 , OpenGL_Version_3_2 , OpenGL_Version_3_3 , OpenGL_Version_4_0 0x00010000 ...} { OpenGL_Version_None , OpenGL_Version_1_1 , OpenGL_Version_1_2 , OpenGL_Version_1_3 , OpenGL_Version_1_4 , OpenGL_Version_1_5 , OpenGL_Version_2_0 , OpenGL_Version_2_1 , OpenGL_ES_Common_Version_1_0 , OpenGL_ES_CommonLite_Version_1_0 , OpenGL_ES_Common_Version_1_1 , OpenGL_ES_CommonLite_Version_1_1 , OpenGL_ES_Version_2_0 , OpenGL_Version_3_0 , OpenGL_Version_3_1 , OpenGL_Version_3_2 , OpenGL_Version_3_3 , OpenGL_Version_4_0 0x00010000 }

This enum describes the various OpenGL versions that are recognized by Qt. Use the QGLFormat::openGLVersionFlags() function to identify which versions that are supported at runtime.

ConstantValueDescription
QGLFormat::OpenGL_Version_None 0x00000000 If no OpenGL is present or if no OpenGL context is current.
QGLFormat::OpenGL_Version_1_1 0x00000001 OpenGL version 1.1 or higher is present.
QGLFormat::OpenGL_Version_1_2 0x00000002 OpenGL version 1.2 or higher is present.
QGLFormat::OpenGL_Version_1_3 0x00000004 OpenGL version 1.3 or higher is present.
QGLFormat::OpenGL_Version_1_4 0x00000008 OpenGL version 1.4 or higher is present.
QGLFormat::OpenGL_Version_1_5 0x00000010 OpenGL version 1.5 or higher is present.
QGLFormat::OpenGL_Version_2_0 0x00000020 OpenGL version 2.0 or higher is present. Note that version 2.0 supports all the functionality of version 1.5.
QGLFormat::OpenGL_Version_2_1 0x00000040 OpenGL version 2.1 or higher is present.
QGLFormat::OpenGL_Version_3_0 0x00001000 OpenGL version 3.0 or higher is present.
QGLFormat::OpenGL_Version_3_1 0x00002000 OpenGL version 3.1 or higher is present. Note that OpenGL version 3.1 or higher does not necessarily support all the features of version 3.0 and lower.
QGLFormat::OpenGL_Version_3_2 0x00004000 OpenGL version 3.2 or higher is present.
QGLFormat::OpenGL_Version_3_3 0x00008000 OpenGL version 3.3 or higher is present.
QGLFormat::OpenGL_Version_4_0 0x00010000 OpenGL version 4.0 or higher is present.
QGLFormat::OpenGL_ES_CommonLite_Version_1_0 0x00000100 OpenGL ES version 1.0 Common Lite or higher is present.
QGLFormat::OpenGL_ES_Common_Version_1_0 0x00000080 OpenGL ES version 1.0 Common or higher is present. The Common profile supports all the features of Common Lite.
QGLFormat::OpenGL_ES_CommonLite_Version_1_1 0x00000400 OpenGL ES version 1.1 Common Lite or higher is present.
QGLFormat::OpenGL_ES_Common_Version_1_1 0x00000200 OpenGL ES version 1.1 Common or higher is present. The Common profile supports all the features of Common Lite.
QGLFormat::OpenGL_ES_Version_2_0 0x00000800 OpenGL ES version 2.0 or higher is present. Note that OpenGL ES version 2.0 does not support all the features of OpenGL ES 1.x. So if OpenGL_ES_Version_2_0 is returned, none of the ES 1.x flags are returned.

See also http://www.opengl.org for more information about the different revisions of OpenGL.

See also openGLVersionFlags().

Look up this member in the source code.

    Public Functions

    Toggle details QGLFormat

    QGLFormatQGLFormat () ()

    Constructs a QGLFormat object with the following default settings:

    Look up this member in the source code.

    Toggle details QGLFormat

    QGLFormatQGLFormat ( QGL::FormatOptions options , int plane=0 ...) ( QGL::FormatOptions options , int plane=0 )

    Creates a QGLFormat object that is a copy of the current defaultFormat().

    If options is not 0, the default format is modified by the specified format options. The options parameter should be QGL::FormatOption values OR'ed together.

    This constructor makes it easy to specify a certain desired format in classes derived from QGLWidget, for example:

    1. // The rendering in MyGLWidget depends on using
    2. // stencil buffer and alpha channel
    3. MyGLWidget::MyGLWidget(QWidget* parent)
    4.     : QGLWidget(QGLFormat(QGL::StencilBuffer | QGL::AlphaChannel), parent)
    5.  {
    6.     if (!format().stencil())
    7.         qWarning("Could not get stencil buffer; results will be suboptimal");
    8.     if (!format().alpha())
    9.         qWarning("Could not get alpha channel; results will be suboptimal");
    10.     ...
    11. }

    Note that there are QGL::FormatOption values to turn format settings both on and off, e.g. QGL::DepthBuffer and QGL::NoDepthBuffer, QGL::DirectRendering and QGL::IndirectRendering, etc.

    The plane parameter defaults to 0 and is the plane which this format should be associated with. Not all OpenGL implementations supports overlay/underlay rendering planes.

    See also defaultFormat(), setOption(), and setPlane().

    Look up this member in the source code.

    Toggle details QGLFormat

    QGLFormatQGLFormat ( const QGLFormat &other ) ( const QGLFormat &other )

    Constructs a copy of other.

    Look up this member in the source code.

    Toggle details QGLFormat

    ~QGLFormat~QGLFormat () ()

    Destroys the QGLFormat.

    Look up this member in the source code.

    Toggle details bool QGLFormat

    accumaccum () ()const

    Returns true if the accumulation buffer is enabled; otherwise returns false. The accumulation buffer is disabled by default.

    See also setAccum() and setAccumBufferSize().

    Look up this member in the source code.

    Toggle details int QGLFormat

    accumBufferSizeaccumBufferSize () ()const

    Returns the accumulation buffer size.

    See also setAccumBufferSize(), accum(), and setAccum().

    Look up this member in the source code.

    Toggle details bool QGLFormat

    alphaalpha () ()const

    Returns true if the alpha buffer in the framebuffer is enabled; otherwise returns false. The alpha buffer is disabled by default.

    See also setAlpha() and setAlphaBufferSize().

    Look up this member in the source code.

    Toggle details int QGLFormat

    alphaBufferSizealphaBufferSize () ()const

    Returns the alpha buffer size.

    See also alpha(), setAlpha(), and setAlphaBufferSize().

    Look up this member in the source code.

    Toggle details int QGLFormat

    blueBufferSizeblueBufferSize () ()const

    Returns the blue buffer size.

    See also setBlueBufferSize().

    Look up this member in the source code.

    Toggle details QGLFormat QGLFormat

    defaultFormatdefaultFormat () () [static]

    Returns the default QGLFormat for the application. All QGLWidget objects that are created use this format unless another format is specified, e.g. when they are constructed.

    If no special default format has been set using setDefaultFormat(), the default format is the same as that created with QGLFormat().

    See also setDefaultFormat().

    Look up this member in the source code.

    Toggle details QGLFormat QGLFormat

    defaultOverlayFormatdefaultOverlayFormat () () [static]

    Returns the default QGLFormat for overlay contexts.

    The default overlay format is:

    See also setDefaultOverlayFormat() and setDefaultFormat().

    Look up this member in the source code.

    Toggle details bool QGLFormat

    depthdepth () ()const

    Returns true if the depth buffer is enabled; otherwise returns false. The depth buffer is enabled by default.

    See also setDepth() and setDepthBufferSize().

    Look up this member in the source code.

    Toggle details int QGLFormat

    depthBufferSizedepthBufferSize () ()const

    Returns the depth buffer size.

    See also depth(), setDepth(), and setDepthBufferSize().

    Look up this member in the source code.

    Toggle details bool QGLFormat

    directRenderingdirectRendering () ()const

    Returns true if direct rendering is enabled; otherwise returns false.

    Direct rendering is enabled by default.

    See also setDirectRendering().

    Look up this member in the source code.

    Toggle details bool QGLFormat

    doubleBufferdoubleBuffer () ()const

    Returns true if double buffering is enabled; otherwise returns false. Double buffering is enabled by default.

    See also setDoubleBuffer().

    Look up this member in the source code.

    Toggle details int QGLFormat

    greenBufferSizegreenBufferSize () ()const

    Returns the green buffer size.

    See also setGreenBufferSize().

    Look up this member in the source code.

    Toggle details bool QGLFormat

    hasOpenGLhasOpenGL () () [static]

    Returns true if the window system has any OpenGL support; otherwise returns false.

    Warning: This function must not be called until the QApplication object has been created.

    Look up this member in the source code.

    Toggle details bool QGLFormat

    hasOpenGLOverlayshasOpenGLOverlays () () [static]

    Returns true if the window system supports OpenGL overlays; otherwise returns false.

    Warning: This function must not be called until the QApplication object has been created.

    Look up this member in the source code.

    Toggle details bool QGLFormat

    hasOverlayhasOverlay () ()const

    Returns true if overlay plane is enabled; otherwise returns false.

    Overlay is disabled by default.

    See also setOverlay().

    Look up this member in the source code.

    Toggle details int QGLFormat

    majorVersionmajorVersion () ()const

    Returns the OpenGL major version.

    See also setVersion() and minorVersion().

    Look up this member in the source code.

    Toggle details int QGLFormat

    minorVersionminorVersion () ()const

    Returns the OpenGL minor version.

    See also setVersion() and majorVersion().

    Look up this member in the source code.

    Toggle details OpenGLVersionFlags QGLFormat

    openGLVersionFlagsopenGLVersionFlags () () [static]

    Identifies, at runtime, which OpenGL versions that are supported by the current platform.

    Note that if OpenGL version 1.5 is supported, its predecessors (i.e., version 1.4 and lower) are also supported. To identify the support of a particular feature, like multi texturing, test for the version in which the feature was first introduced (i.e., version 1.3 in the case of multi texturing) to adapt to the largest possible group of runtime platforms.

    This function needs a valid current OpenGL context to work; otherwise it will return OpenGL_Version_None.

    See also hasOpenGL() and hasOpenGLOverlays().

    Look up this member in the source code.

    Toggle details int QGLFormat

    planeplane () ()const

    Returns the plane of this format. The default for normal formats is 0, which means the normal plane. The default for overlay formats is 1, which is the first overlay plane.

    See also setPlane() and defaultOverlayFormat().

    Look up this member in the source code.

    Toggle details OpenGLContextProfile QGLFormat

    profileprofile () ()const

    Returns the OpenGL context profile.

    See also setProfile().

    Look up this member in the source code.

    Toggle details int QGLFormat

    redBufferSizeredBufferSize () ()const

    Returns the red buffer size.

    See also setRedBufferSize().

    Look up this member in the source code.

    Toggle details bool QGLFormat

    rgbargba () ()const

    Returns true if RGBA color mode is set. Returns false if color index mode is set. The default color mode is RGBA.

    See also setRgba().

    Look up this member in the source code.

    Toggle details bool QGLFormat

    sampleBufferssampleBuffers () ()const

    Returns true if multisample buffer support is enabled; otherwise returns false.

    The multisample buffer is disabled by default.

    See also setSampleBuffers().

    Look up this member in the source code.

    Toggle details int QGLFormat

    samplessamples () ()const

    Returns the number of samples per pixel when multisampling is enabled. By default, the highest number of samples that is available is used.

    See also setSampleBuffers(), sampleBuffers(), and setSamples().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setAccumsetAccum ( bool enable ) ( bool enable )

    If enable is true enables the accumulation buffer; otherwise disables the accumulation buffer.

    The accumulation buffer is disabled by default.

    The accumulation buffer is used to create blur effects and multiple exposures.

    See also accum() and setAccumBufferSize().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setAccumBufferSizesetAccumBufferSize ( int size ) ( int size )

    Set the preferred accumulation buffer size, where size is the bit depth for each RGBA component.

    See also accum(), setAccum(), and accumBufferSize().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setAlphasetAlpha ( bool enable ) ( bool enable )

    If enable is true enables the alpha buffer; otherwise disables the alpha buffer.

    The alpha buffer is disabled by default.

    The alpha buffer is typically used for implementing transparency or translucency. The A in RGBA specifies the transparency of a pixel.

    See also alpha() and setAlphaBufferSize().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setAlphaBufferSizesetAlphaBufferSize ( int size ) ( int size )

    Set the preferred alpha buffer size to size. This function implicitly enables the alpha channel.

    See also setRedBufferSize(), setGreenBufferSize(), and alphaBufferSize().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setBlueBufferSizesetBlueBufferSize ( int size ) ( int size )

    Set the preferred blue buffer size to size.

    See also blueBufferSize(), setRedBufferSize(), setGreenBufferSize(), and setAlphaBufferSize().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setDefaultFormatsetDefaultFormat ( const QGLFormat &f ) ( const QGLFormat &f ) [static]

    Sets a new default QGLFormat for the application to f. For example, to set single buffering as the default instead of double buffering, your main() might contain code like this:

    1.                     QApplication a(argc, argv);
    2. f.setDoubleBuffer(false);
    3. QGLFormat::setDefaultFormat(f);

    See also defaultFormat().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setDefaultOverlayFormatsetDefaultOverlayFormat ( const QGLFormat &f ) ( const QGLFormat &f ) [static]

    Sets a new default QGLFormat for overlay contexts to f. This format is used whenever a QGLWidget is created with a format that hasOverlay() enabled.

    For example, to get a double buffered overlay context (if available), use code like this:

    1.                     QGLFormat f = QGLFormat::defaultOverlayFormat();
    2. f.setDoubleBuffer(true);
    3. QGLFormat::setDefaultOverlayFormat(f);

    As usual, you can find out after widget creation whether the underlying OpenGL system was able to provide the requested specification:

    1. // ...continued from above
    2. MyGLWidget* myWidget = new MyGLWidget(QGLFormat(QGL::HasOverlay), ...);
    3. if (myWidget->format().hasOverlay())  {
    4.     // Yes, we got an overlay, let's check _its_ format:
    5.     QGLContext* olContext = myWidget->overlayContext();
    6.     if (olContext->format().doubleBuffer())
    7.         ; // yes, we got a double buffered overlay
    8.     else
    9.         ; // no, only single buffered overlays are available
    10. }

    See also defaultOverlayFormat().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setDepthsetDepth ( bool enable ) ( bool enable )

    If enable is true enables the depth buffer; otherwise disables the depth buffer.

    The depth buffer is enabled by default.

    The purpose of a depth buffer (or Z-buffering) is to remove hidden surfaces. Pixels are assigned Z values based on the distance to the viewer. A pixel with a high Z value is closer to the viewer than a pixel with a low Z value. This information is used to decide whether to draw a pixel or not.

    See also depth() and setDepthBufferSize().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setDepthBufferSizesetDepthBufferSize ( int size ) ( int size )

    Set the minimum depth buffer size to size.

    See also depthBufferSize(), setDepth(), and depth().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setDirectRenderingsetDirectRendering ( bool enable ) ( bool enable )

    If enable is true enables direct rendering; otherwise disables direct rendering.

    Direct rendering is enabled by default.

    Enabling this option will make OpenGL bypass the underlying window system and render directly from hardware to the screen, if this is supported by the system.

    See also directRendering().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setDoubleBuffersetDoubleBuffer ( bool enable ) ( bool enable )

    If enable is true sets double buffering; otherwise sets single buffering.

    Double buffering is enabled by default.

    Double buffering is a technique where graphics are rendered on an off-screen buffer and not directly to the screen. When the drawing has been completed, the program calls a swapBuffers() function to exchange the screen contents with the buffer. The result is flicker-free drawing and often better performance.

    Note that single buffered contexts are currently not supported with EGL.

    See also doubleBuffer(), QGLContext::swapBuffers(), and QGLWidget::swapBuffers().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setGreenBufferSizesetGreenBufferSize ( int size ) ( int size )

    Set the preferred green buffer size to size.

    See also greenBufferSize(), setRedBufferSize(), setBlueBufferSize(), and setAlphaBufferSize().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setOptionsetOption ( QGL::FormatOptions opt ) ( QGL::FormatOptions opt )

    Sets the format option to opt.

    See also testOption().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setOverlaysetOverlay ( bool enable ) ( bool enable )

    If enable is true enables an overlay plane; otherwise disables the overlay plane.

    Enabling the overlay plane will cause QGLWidget to create an additional context in an overlay plane. See the QGLWidget documentation for further information.

    See also hasOverlay().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setPlanesetPlane ( int plane ) ( int plane )

    Sets the requested plane to plane. 0 is the normal plane, 1 is the first overlay plane, 2 is the second overlay plane, etc.; -1, -2, etc. are underlay planes.

    Note that in contrast to other format specifications, the plane specifications will be matched exactly. This means that if you specify a plane that the underlying OpenGL system cannot provide, an invalid QGLWidget will be created.

    See also plane().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setProfilesetProfile ( OpenGLContextProfile profile ) ( OpenGLContextProfile profile )

    Set the OpenGL context profile to profile. The profile is ignored if the requested OpenGL version is less than 3.2.

    See also profile().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setRedBufferSizesetRedBufferSize ( int size ) ( int size )

    Set the preferred red buffer size to size.

    See also redBufferSize(), setGreenBufferSize(), setBlueBufferSize(), and setAlphaBufferSize().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setRgbasetRgba ( bool enable ) ( bool enable )

    If enable is true sets RGBA mode. If enable is false sets color index mode.

    The default color mode is RGBA.

    RGBA is the preferred mode for most OpenGL applications. In RGBA color mode you specify colors as red + green + blue + alpha quadruplets.

    In color index mode you specify an index into a color lookup table.

    See also rgba().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setSampleBufferssetSampleBuffers ( bool enable ) ( bool enable )

    If enable is true, a GL context with multisample buffer support is picked; otherwise ignored.

    See also sampleBuffers(), setSamples(), and samples().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setSamplessetSamples ( int numSamples ) ( int numSamples )

    Set the preferred number of samples per pixel when multisampling is enabled to numSamples. By default, the highest number of samples available is used.

    See also setSampleBuffers(), sampleBuffers(), and samples().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setStencilsetStencil ( bool enable ) ( bool enable )

    If enable is true enables the stencil buffer; otherwise disables the stencil buffer.

    The stencil buffer is enabled by default.

    The stencil buffer masks certain parts of the drawing area so that masked parts are not drawn on.

    See also stencil() and setStencilBufferSize().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setStencilBufferSizesetStencilBufferSize ( int size ) ( int size )

    Set the preferred stencil buffer size to size.

    See also stencilBufferSize(), setStencil(), and stencil().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setStereosetStereo ( bool enable ) ( bool enable )

    If enable is true enables stereo buffering; otherwise disables stereo buffering.

    Stereo buffering is disabled by default.

    Stereo buffering provides extra color buffers to generate left-eye and right-eye images.

    See also stereo().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setSwapIntervalsetSwapInterval ( int interval ) ( int interval )

    Set the preferred swap interval. This can be used to sync the GL drawing into a system window to the vertical refresh of the screen. Setting an interval value of 0 will turn the vertical refresh syncing off, any value higher than 0 will turn the vertical syncing on.

    Under Windows and under X11, where the WGL_EXT_swap_control and GLX_SGI_video_sync extensions are used, the interval parameter can be used to set the minimum number of video frames that are displayed before a buffer swap will occur. In effect, setting the interval to 10, means there will be 10 vertical retraces between every buffer swap.

    Under Windows the WGL_EXT_swap_control extension has to be present, and under X11 the GLX_SGI_video_sync extension has to be present.

    See also swapInterval().

    Look up this member in the source code.

    Toggle details void QGLFormat

    setVersionsetVersion ( int major , int minor ) ( int major , int minor )

    Set the OpenGL version to the major and minor numbers. If a context compatible with the requested OpenGL version cannot be created, a context compatible with version 1.x is created instead.

    See also majorVersion() and minorVersion().

    Look up this member in the source code.

    Toggle details bool QGLFormat

    stencilstencil () ()const

    Returns true if the stencil buffer is enabled; otherwise returns false. The stencil buffer is enabled by default.

    See also setStencil() and setStencilBufferSize().

    Look up this member in the source code.

    Toggle details int QGLFormat

    stencilBufferSizestencilBufferSize () ()const

    Returns the stencil buffer size.

    See also stencil(), setStencil(), and setStencilBufferSize().

    Look up this member in the source code.

    Toggle details bool QGLFormat

    stereostereo () ()const

    Returns true if stereo buffering is enabled; otherwise returns false. Stereo buffering is disabled by default.

    See also setStereo().

    Look up this member in the source code.

    Toggle details int QGLFormat

    swapIntervalswapInterval () ()const

    Returns the currently set swap interval. -1 is returned if setting the swap interval isn't supported in the system GL implementation.

    See also setSwapInterval().

    Look up this member in the source code.

    Toggle details bool QGLFormat

    testOptiontestOption ( QGL::FormatOptions opt ) ( QGL::FormatOptions opt )const

    Returns true if format option opt is set; otherwise returns false.

    See also setOption().

    Look up this member in the source code.

    Toggle details QGLFormat & QGLFormat

    operator=operator= ( const QGLFormat &other ) ( const QGLFormat &other )

    Assigns other to this object.

    Look up this member in the source code.

      Notes provided by the Qt Community

      No notes