Skip to content

PythonQt.QtGui.QOpenGLWidget · declarations 001

Back to PythonQt.QtGui.QOpenGLWidget

NoPartialUpdate instance-attribute

NoPartialUpdate: Any

PartialUpdate instance-attribute

PartialUpdate: Any

UpdateBehavior instance-attribute

UpdateBehavior: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

aboutToCompose

aboutToCompose(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QOpenGLWidget.aboutToCompose; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QOpenGLWidget::aboutToCompose()

This signal is emitted when the widget's top-level window is about to begin composing the textures of its QOpenGLWidget children and the other widgets.

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#aboutToCompose

aboutToResize

aboutToResize(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QOpenGLWidget.aboutToResize; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QOpenGLWidget::aboutToResize()

This signal is emitted when the widget's size is changed and therefore the framebuffer object is going to be recreated.

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#aboutToResize

context

context() -> Any

X.context() -> PythonQt.QtGui.QOpenGLContext

Supplemental documentation: Qt 5 reference:

QOpenGLContext *QOpenGLWidget::context() const

Returns The QOpenGLContext used by this widget or 0 if not yet initialized.

Note: The context and the framebuffer object used by the widget changes when reparenting the widget via setParent().

See also QOpenGLContext::setShareContext() and defaultFramebufferObject().

Upstream PySide2 reference signatures (binding differences may apply):

context(self) -> PySide2.QtGui.QOpenGLContext

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#context

customContextMenuRequested

customContextMenuRequested(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QOpenGLWidget.customContextMenuRequested; argument details are not documented.

defaultFramebufferObject

defaultFramebufferObject() -> int

X.defaultFramebufferObject() -> int

Supplemental documentation: Qt 5 reference:

GLuint QOpenGLWidget::defaultFramebufferObject() const

Returns The framebuffer object handle or 0 if not yet initialized.

Note: The framebuffer object belongs to the context returned by context() and may not be accessible from other contexts.

Note: The context and the framebuffer object used by the widget changes when reparenting the widget via setParent(). In addition, the framebuffer object changes on each resize.

See also context().

Upstream PySide2 reference signatures (binding differences may apply):

defaultFramebufferObject(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#defaultFramebufferObject

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QOpenGLWidget.destroyed; argument details are not documented.

doneCurrent

doneCurrent() -> None

X.doneCurrent()

Supplemental documentation: Qt 5 reference:

void QOpenGLWidget::doneCurrent()

Releases the context.

It is not necessary to call this function in most cases, since the widget will make sure the context is bound and released properly when invoking paintGL().

Upstream PySide2 reference signatures (binding differences may apply):

doneCurrent(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#doneCurrent

event

event(e: Any) -> bool

X.event(e) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QOpenGLWidget::event(QEvent *e)

Reimplements: QWidget::event(QEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

event(self, e: PySide2.QtCore.QEvent) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#event

format

format() -> Any

X.format() -> PythonQt.QtGui.QSurfaceFormat

Supplemental documentation: Qt 5 reference:

QSurfaceFormat QOpenGLWidget::format() const

Returns the context and surface format used by this widget and its toplevel window.

After the widget and its toplevel have both been created, resized and shown, this function will return the actual format of the context. This may differ from the requested format if the request could not be fulfilled by the platform. It is also possible to get larger color buffer sizes than requested.

When the widget's window and the related OpenGL resources are not yet initialized, the return value is the format that has been set via setFormat().

See also setFormat() and context().

Upstream PySide2 reference signatures (binding differences may apply):

format(self) -> PySide2.QtGui.QSurfaceFormat

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#format

frameSwapped

frameSwapped(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QOpenGLWidget.frameSwapped; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QOpenGLWidget::frameSwapped()

This signal is emitted after the widget's top-level window has finished composition and returned from its potentially blocking QOpenGLContext::swapBuffers() call.

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#frameSwapped

grabFramebuffer

grabFramebuffer() -> Any

X.grabFramebuffer() -> PythonQt.QtGui.QImage

Supplemental documentation: Qt 5 reference:

QImage QOpenGLWidget::grabFramebuffer()

Renders and returns a 32-bit RGB image of the framebuffer.

Note: This is a potentially expensive operation because it relies on glReadPixels() to read back the pixels. This may be slow and can stall the GPU pipeline.

Upstream PySide2 reference signatures (binding differences may apply):

grabFramebuffer(self) -> PySide2.QtGui.QImage

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#grabFramebuffer

initializeGL

initializeGL() -> None

X.initializeGL()

Supplemental documentation: Qt 5 reference:

[virtual protected] void QOpenGLWidget::initializeGL()

This virtual function is called once before the first call to paintGL() or resizeGL(). Reimplement it in a subclass.

This function should set up any required OpenGL resources and state.

There is no need to call makeCurrent() because this has already been done when this function is called. Note however that the framebuffer is not yet available at this stage, so avoid issuing draw calls from here. Defer such calls to paintGL() instead.

See also paintGL() and resizeGL().

Upstream PySide2 reference signatures (binding differences may apply):

initializeGL(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#initializeGL

isValid

isValid() -> bool

X.isValid() -> bool

Supplemental documentation: Qt 5 reference:

bool QOpenGLWidget::isValid() const

Returns true if the widget and OpenGL resources, like the context, have been successfully initialized. Note that the return value is always false until the widget is shown.

Upstream PySide2 reference signatures (binding differences may apply):

isValid(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#isValid

makeCurrent

makeCurrent() -> None

X.makeCurrent()

Supplemental documentation: Qt 5 reference:

void QOpenGLWidget::makeCurrent()

Prepares for rendering OpenGL content for this widget by making the corresponding context current and binding the framebuffer object in that context.

It is not necessary to call this function in most cases, because it is called automatically before invoking paintGL().

See also context(), paintGL(), and doneCurrent().

Upstream PySide2 reference signatures (binding differences may apply):

makeCurrent(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#makeCurrent

metric

metric(metric: Any) -> int

X.metric(metric) -> int

Supplemental documentation: Qt 5 reference:

[override virtual protected] int QOpenGLWidget::metric(QPaintDevice::PaintDeviceMetric metric) const

Reimplements: QWidget::metric(QPaintDevice::PaintDeviceMetric m) const.

Upstream PySide2 reference signatures (binding differences may apply):

metric(self, metric: PySide2.QtGui.QPaintDevice.PaintDeviceMetric) -> int

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#metric

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QOpenGLWidget.objectNameChanged; argument details are not documented.

paintEngine

paintEngine() -> Any

X.paintEngine() -> PythonQt.QtGui.QPaintEngine

Supplemental documentation: Qt 5 reference:

[override virtual protected] QPaintEngine *QOpenGLWidget::paintEngine() const

Reimplements: QWidget::paintEngine() const.

Upstream PySide2 reference signatures (binding differences may apply):

paintEngine(self) -> PySide2.QtGui.QPaintEngine

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#paintEngine

paintEvent

paintEvent(e: Any) -> None

X.paintEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QOpenGLWidget::paintEvent(QPaintEvent *e)

Reimplements: QWidget::paintEvent(QPaintEvent *event).

Handles paint events.

Calling QWidget::update() will lead to sending a paint event e, and thus invoking this function. (NB this is asynchronous and will happen at some point after returning from update()). This function will then, after some preparation, call the virtual paintGL() to update the contents of the QOpenGLWidget's framebuffer. The widget's top-level window will then composite the framebuffer's texture with the rest of the window.

Upstream PySide2 reference signatures (binding differences may apply):

paintEvent(self, e: PySide2.QtGui.QPaintEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#paintEvent

paintGL

paintGL() -> None

X.paintGL()

Supplemental documentation: Qt 5 reference:

[virtual protected] void QOpenGLWidget::paintGL()

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.

Before invoking this function, the context and the framebuffer are bound, and the viewport is set up by a call to glViewport(). No other state is set and no clearing or drawing is performed by the framework.

See also initializeGL() and resizeGL().

Upstream PySide2 reference signatures (binding differences may apply):

paintGL(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#paintGL

redirected

redirected(p: Any) -> Any

X.redirected(p) -> PythonQt.QtGui.QPaintDevice

Supplemental documentation: Qt 5 reference:

[override virtual protected] QPaintDevice *QOpenGLWidget::redirected(QPoint *p) const

Upstream PySide2 reference signatures (binding differences may apply):

redirected(self, p: PySide2.QtCore.QPoint) -> PySide2.QtGui.QPaintDevice

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#redirected

resizeEvent

resizeEvent(e: Any) -> None

X.resizeEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QOpenGLWidget::resizeEvent(QResizeEvent *e)

Reimplements: QWidget::resizeEvent(QResizeEvent *event).

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

Note: Avoid overriding this function in derived classes. If that is not feasible, make sure that QOpenGLWidget's implementation is invoked too. Otherwise the underlying framebuffer object and related resources will not get resized properly and will lead to incorrect rendering.

Upstream PySide2 reference signatures (binding differences may apply):

resizeEvent(self, e: PySide2.QtGui.QResizeEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#resizeEvent

resizeGL

resizeGL(w: int, h: int) -> None

X.resizeGL(w, h)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QOpenGLWidget::resizeGL(int w, int h)

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

There is no need to call makeCurrent() because this has already been done when this function is called. Additionally, the framebuffer is also bound.

See also initializeGL() and paintGL().

Upstream PySide2 reference signatures (binding differences may apply):

resizeGL(self, w: int, h: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#resizeGL

resized

resized(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QOpenGLWidget.resized; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QOpenGLWidget::resized()

This signal is emitted right after the framebuffer object has been recreated due to resizing the widget.

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#resized

setFormat

setFormat(format: Any) -> None

X.setFormat(format)

Supplemental documentation: Qt 5 reference:

void QOpenGLWidget::setFormat(const QSurfaceFormat \&format)

Sets the requested surface format.

When the format is not explicitly set via this function, the format returned by QSurfaceFormat::defaultFormat() will be used. This means that when having multiple OpenGL widgets, individual calls to this function can be replaced by one single call to QSurfaceFormat::setDefaultFormat() before creating the first widget.

Note: Requesting an alpha buffer via this function will not lead to the desired results when the intention is to make other widgets beneath visible. Instead, use Qt::WA_AlwaysStackOnTop to enable semi-transparent QOpenGLWidget instances with other widgets visible underneath. Keep in mind however that this breaks the stacking order, so it will no longer be possible to have other widgets on top of the QOpenGLWidget.

See also format(), Qt::WA_AlwaysStackOnTop, and QSurfaceFormat::setDefaultFormat().

Upstream PySide2 reference signatures (binding differences may apply):

setFormat(self, format: PySide2.QtGui.QSurfaceFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#setFormat

setUpdateBehavior

setUpdateBehavior(updateBehavior: Any) -> None

X.setUpdateBehavior(updateBehavior)

Supplemental documentation: Qt 5 reference:

void QOpenGLWidget::setUpdateBehavior(QOpenGLWidget::UpdateBehavior updateBehavior)

Sets this widget's update behavior to updateBehavior.

This function was introduced in Qt 5.5.

See also updateBehavior().

Upstream PySide2 reference signatures (binding differences may apply):

setUpdateBehavior(self, updateBehavior: PySide2.QtWidgets.QOpenGLWidget.UpdateBehavior) -> None

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#setUpdateBehavior

updateBehavior

updateBehavior() -> Any

X.updateBehavior()

Supplemental documentation: Qt 5 reference:

QOpenGLWidget::UpdateBehavior QOpenGLWidget::updateBehavior() const

Returns the update behavior of the widget.

This function was introduced in Qt 5.5.

See also setUpdateBehavior().

Upstream PySide2 reference signatures (binding differences may apply):

updateBehavior(self) -> PySide2.QtWidgets.QOpenGLWidget.UpdateBehavior

Source: https://doc.qt.io/archives/qt-5.15/qopenglwidget.html#updateBehavior

windowIconChanged

windowIconChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QOpenGLWidget.windowIconChanged; argument details are not documented.

windowIconTextChanged

windowIconTextChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QOpenGLWidget.windowIconTextChanged; argument details are not documented.

windowTitleChanged

windowTitleChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QOpenGLWidget.windowTitleChanged; argument details are not documented.