PythonQt.Qt.QGLFormat
QGLFormat
PythonQtInstanceWrapper object
Native bases: PythonQtInstanceWrapper
Supplemental documentation: Qt 5 reference:
Detailed Description
A display format has several characteristics:
- Double or single buffering.
- Depth buffer.
- RGBA or color index mode.
- Alpha channel.
- Accumulation buffer.
- Stencil buffer.
- Stereo buffers.
- Direct rendering.
- Presence of an overlay.
- Plane of an overlay.
- Multisample buffers.
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:
QGLFormat fmt;
fmt.setAlpha(true);
fmt.setStereo(true);
QGLFormat::setDefaultFormat(fmt);
Or you can specify the desired format when creating an object of your QGLWidget subclass:
QGLFormat fmt;
fmt.setDoubleBuffer(false); // single buffer
fmt.setDirectRendering(false); // software rendering
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:
QGLFormat fmt;
fmt.setOverlay(true);
fmt.setStereo(true);
MyGLWidget* myWidget = new MyGLWidget(fmt, ...);
if (!myWidget->format().stereo()) {
// ok, goggles off
if (!myWidget->format().hasOverlay()) {
qFatal("Cool hardware required");
}
}
OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.
Source: https://doc.qt.io/archives/qt-5.15/qglformat.html
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
CompatibilityProfile |
attribute | Any |
(shared captured text) |
CoreProfile |
attribute | Any |
(shared captured text) |
NoProfile |
attribute | Any |
(shared captured text) |
OpenGLContextProfile |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
OpenGLVersionFlag |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
OpenGLVersionFlags |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
OpenGL_ES_CommonLite_Version_1_0 |
attribute | Any |
(shared captured text) |
OpenGL_ES_CommonLite_Version_1_1 |
attribute | Any |
(shared captured text) |
OpenGL_ES_Common_Version_1_0 |
attribute | Any |
(shared captured text) |
OpenGL_ES_Common_Version_1_1 |
attribute | Any |
(shared captured text) |
OpenGL_ES_Version_2_0 |
attribute | Any |
(shared captured text) |
OpenGL_Version_1_1 |
attribute | Any |
(shared captured text) |
OpenGL_Version_1_2 |
attribute | Any |
(shared captured text) |
OpenGL_Version_1_3 |
attribute | Any |
(shared captured text) |
OpenGL_Version_1_4 |
attribute | Any |
(shared captured text) |
OpenGL_Version_1_5 |
attribute | Any |
(shared captured text) |
OpenGL_Version_2_0 |
attribute | Any |
(shared captured text) |
OpenGL_Version_2_1 |
attribute | Any |
(shared captured text) |
OpenGL_Version_3_0 |
attribute | Any |
(shared captured text) |
OpenGL_Version_3_1 |
attribute | Any |
(shared captured text) |
OpenGL_Version_3_2 |
attribute | Any |
(shared captured text) |
OpenGL_Version_3_3 |
attribute | Any |
(shared captured text) |
OpenGL_Version_4_0 |
attribute | Any |
(shared captured text) |
OpenGL_Version_4_1 |
attribute | Any |
(shared captured text) |
OpenGL_Version_4_2 |
attribute | Any |
(shared captured text) |
OpenGL_Version_4_3 |
attribute | Any |
(shared captured text) |
OpenGL_Version_None |
attribute | Any |
(shared captured text) |
__init__ |
function | (self, *args: Any, **kwargs: Any) -> None |
Native constructor; consult class documentation for supported overloads. (shared captured text) |
accum |
function | (self) -> bool |
X.accum() -> bool (shared captured text) |
accumBufferSize |
function | (self) -> int |
X.accumBufferSize() -> int (shared captured text) |
alpha |
function | (self) -> bool |
X.alpha() -> bool (shared captured text) |
alphaBufferSize |
function | (self) -> int |
X.alphaBufferSize() -> int (shared captured text) |
blueBufferSize |
function | (self) -> int |
X.blueBufferSize() -> int (shared captured text) |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
defaultFormat |
function | (self) -> Any |
X.defaultFormat() -> PythonQt.QtOpenGL.QGLFormat (shared captured text) |
defaultOverlayFormat |
function | (self) -> Any |
X.defaultOverlayFormat() -> PythonQt.QtOpenGL.QGLFormat (shared captured text) |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
depth |
function | (self) -> bool |
X.depth() -> bool (shared captured text) |
depthBufferSize |
function | (self) -> int |
X.depthBufferSize() -> int (shared captured text) |
directRendering |
function | (self) -> bool |
X.directRendering() -> bool (shared captured text) |
doubleBuffer |
function | (self) -> bool |
X.doubleBuffer() -> bool (shared captured text) |
fromSurfaceFormat |
function | (self, format: Any) -> Any |
X.fromSurfaceFormat(format) -> PythonQt.QtOpenGL.QGLFormat (shared captured text) |
greenBufferSize |
function | (self) -> int |
X.greenBufferSize() -> int (shared captured text) |
hasOpenGL |
function | (self) -> bool |
X.hasOpenGL() -> bool (shared captured text) |
hasOpenGLOverlays |
function | (self) -> bool |
X.hasOpenGLOverlays() -> bool (shared captured text) |
hasOverlay |
function | (self) -> bool |
X.hasOverlay() -> bool (shared captured text) |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
majorVersion |
function | (self) -> int |
X.majorVersion() -> int (shared captured text) |
minorVersion |
function | (self) -> int |
X.minorVersion() -> int (shared captured text) |
openGLVersionFlags |
function | (self) -> Any |
Identifies, at runtime, which OpenGL versions that are supported by the current platform. (shared captured text) |
plane |
function | (self) -> int |
X.plane() -> int (shared captured text) |
profile |
function | (self) -> Any |
Returns the OpenGL context profile. (shared captured text) |
redBufferSize |
function | (self) -> int |
X.redBufferSize() -> int (shared captured text) |
rgba |
function | (self) -> bool |
X.rgba() -> bool (shared captured text) |
sampleBuffers |
function | (self) -> bool |
X.sampleBuffers() -> bool (shared captured text) |
samples |
function | (self) -> int |
X.samples() -> int (shared captured text) |
setAccum |
function | (self, enable: bool) -> None |
If enable is true enables the accumulation buffer; otherwise disables the accumulation buffer. (shared captured text) |
setAccumBufferSize |
function | (self, size: int) -> None |
Set the preferred accumulation buffer size, where size is the bit depth for each RGBA component. (shared captured text) |
setAlpha |
function | (self, enable: bool) -> None |
If enable is true enables the alpha buffer; otherwise disables the alpha buffer. (shared captured text) |
setAlphaBufferSize |
function | (self, size: int) -> None |
Set the preferred alpha buffer size to size. (shared captured text) |
setBlueBufferSize |
function | (self, size: int) -> None |
Set the preferred blue buffer size to size. (shared captured text) |
setDefaultFormat |
function | (self, f: Any) -> None |
(shared captured text) |
setDefaultOverlayFormat |
function | (self, f: Any) -> None |
Sets a new default [QGLFormat](https://doc.qt.io/archives/qt-5.15/qglformat.html) for overlay contexts to f. (shared captured text) |
setDepth |
function | (self, enable: bool) -> None |
If enable is true enables the depth buffer; otherwise disables the depth buffer. (shared captured text) |
setDepthBufferSize |
function | (self, size: int) -> None |
Set the minimum depth buffer size to size. (shared captured text) |
setDirectRendering |
function | (self, enable: bool) -> None |
If enable is true enables direct rendering; otherwise disables direct rendering. (shared captured text) |
setDoubleBuffer |
function | (self, enable: bool) -> None |
If enable is true sets double buffering; otherwise sets single buffering. (shared captured text) |
setGreenBufferSize |
function | (self, size: int) -> None |
Set the preferred green buffer size to size. (shared captured text) |
setOption |
function | (self, opt: Any) -> None |
Sets the format option to opt. (shared captured text) |
setOverlay |
function | (self, enable: bool) -> None |
If enable is true enables an overlay plane; otherwise disables the overlay plane. (shared captured text) |
setPlane |
function | (self, plane: int) -> None |
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. (shared captured text) |
setProfile |
function | (self, profile: Any) -> None |
Set the OpenGL context profile to profile. (shared captured text) |
setRedBufferSize |
function | (self, size: int) -> None |
Set the preferred red buffer size to size. (shared captured text) |
setRgba |
function | (self, enable: bool) -> None |
If enable is true sets RGBA mode. (shared captured text) |
setSampleBuffers |
function | (self, enable: bool) -> None |
If enable is true, a GL context with multisample buffer support is picked; otherwise ignored. (shared captured text) |
setSamples |
function | (self, numSamples: int) -> None |
Set the preferred number of samples per pixel when multisampling is enabled to numSamples. (shared captured text) |
setStencil |
function | (self, enable: bool) -> None |
If enable is true enables the stencil buffer; otherwise disables the stencil buffer. (shared captured text) |
setStencilBufferSize |
function | (self, size: int) -> None |
Set the preferred stencil buffer size to size. (shared captured text) |
setStereo |
function | (self, enable: bool) -> None |
If enable is true enables stereo buffering; otherwise disables stereo buffering. (shared captured text) |
setSwapInterval |
function | (self, interval: int) -> None |
Set the preferred swap interval. (shared captured text) |
setVersion |
function | (self, major: int, minor: int) -> None |
X.setVersion(major, minor) (shared captured text) |
stencil |
function | (self) -> bool |
X.stencil() -> bool (shared captured text) |
stencilBufferSize |
function | (self) -> int |
X.stencilBufferSize() -> int (shared captured text) |
stereo |
function | (self) -> bool |
X.stereo() -> bool (shared captured text) |
swapInterval |
function | (self) -> int |
X.swapInterval() -> int (shared captured text) |
testOption |
function | (self, opt: Any) -> bool |
X.testOption(opt) -> bool (shared captured text) |
toSurfaceFormat |
function | (self, format: Any) -> Any |
X.toSurfaceFormat(format) -> PythonQt.QtGui.QSurfaceFormat (shared captured text) |