[][src]Struct qt_gui::QOpenGLContext

#[repr(C)]
pub struct QOpenGLContext { /* fields omitted */ }

The QOpenGLContext class represents a native OpenGL context, enabling OpenGL rendering on a QSurface.

C++ class: QOpenGLContext.

C++ documentation:

The QOpenGLContext class represents a native OpenGL context, enabling OpenGL rendering on a QSurface.

QOpenGLContext represents the OpenGL state of an underlying OpenGL context. To set up a context, set its screen and format such that they match those of the surface or surfaces with which the context is meant to be used, if necessary make it share resources with other contexts with setShareContext(), and finally call create(). Use the return value or isValid() to check if the context was successfully initialized.

A context can be made current against a given surface by calling makeCurrent(). When OpenGL rendering is done, call swapBuffers() to swap the front and back buffers of the surface, so that the newly rendered content becomes visible. To be able to support certain platforms, QOpenGLContext requires that you call makeCurrent() again before starting rendering a new frame, after calling swapBuffers().

If the context is temporarily not needed, such as when the application is not rendering, it can be useful to delete it in order to free resources. You can connect to the aboutToBeDestroyed() signal to clean up any resources that have been allocated with different ownership from the QOpenGLContext itself.

Once a QOpenGLContext has been made current, you can render to it in a platform independent way by using Qt's OpenGL enablers such as QOpenGLFunctions, QOpenGLBuffer, QOpenGLShaderProgram, and QOpenGLFramebufferObject. It is also possible to use the platform's OpenGL API directly, without using the Qt enablers, although potentially at the cost of portability. The latter is necessary when wanting to use OpenGL 1.x or OpenGL ES 1.x.

For more information about the OpenGL API, refer to the official OpenGL documentation.

For an example of how to use QOpenGLContext see the OpenGL Window example.

Methods

impl QOpenGLContext[src]

pub fn about_to_be_destroyed(&self) -> Signal<()>[src]

This signal is emitted before the underlying native OpenGL context is destroyed, such that users may clean up OpenGL resources that might otherwise be left dangling in the case of shared OpenGL contexts.

Returns a built-in Qt signal QOpenGLContext::aboutToBeDestroyed that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted before the underlying native OpenGL context is destroyed, such that users may clean up OpenGL resources that might otherwise be left dangling in the case of shared OpenGL contexts.

If you wish to make the context current in order to do clean-up, make sure to only connect to the signal using a direct connection.

pub unsafe fn are_sharing(
    first: impl CastInto<MutPtr<QOpenGLContext>>,
    second: impl CastInto<MutPtr<QOpenGLContext>>
) -> bool
[src]

Returns true if the first and second contexts are sharing OpenGL resources.

Calls C++ function: static bool QOpenGLContext::areSharing(QOpenGLContext* first, QOpenGLContext* second).

C++ documentation:

Returns true if the first and second contexts are sharing OpenGL resources.

pub unsafe fn create(&mut self) -> bool[src]

Attempts to create the OpenGL context with the current configuration.

Calls C++ function: bool QOpenGLContext::create().

C++ documentation:

Attempts to create the OpenGL context with the current configuration.

The current configuration includes the format, the share context, and the screen.

If the OpenGL implementation on your system does not support the requested version of OpenGL context, then QOpenGLContext will try to create the closest matching version. The actual created context properties can be queried using the QSurfaceFormat returned by the format() function. For example, if you request a context that supports OpenGL 4.3 Core profile but the driver and/or hardware only supports version 3.2 Core profile contexts then you will get a 3.2 Core profile context.

Returns true if the native context was successfully created and is ready to be used with makeCurrent(), swapBuffers(), etc.

Note: If the context already exists, this function destroys the existing context first, and then creates a new one.

See also makeCurrent() and format().

pub unsafe fn current_context() -> MutPtr<QOpenGLContext>[src]

Returns the last context which called makeCurrent in the current thread, or 0, if no context is current.

Calls C++ function: static QOpenGLContext* QOpenGLContext::currentContext().

C++ documentation:

Returns the last context which called makeCurrent in the current thread, or 0, if no context is current.

pub unsafe fn default_framebuffer_object(&self) -> u32[src]

Call this to get the default framebuffer object for the current surface.

Calls C++ function: GLuint QOpenGLContext::defaultFramebufferObject() const.

C++ documentation:

Call this to get the default framebuffer object for the current surface.

On some platforms (for instance, iOS) the default framebuffer object depends on the surface being rendered to, and might be different from 0. Thus, instead of calling glBindFramebuffer(0), you should call glBindFramebuffer(ctx->defaultFramebufferObject()) if you want your application to work across different Qt platforms.

If you use the glBindFramebuffer() in QOpenGLFunctions you do not have to worry about this, as it automatically binds the current context's defaultFramebufferObject() when 0 is passed.

Note: Widgets that render via framebuffer objects, like QOpenGLWidget and QQuickWidget, will override the value returned from this function when painting is active, because at that time the correct "default" framebuffer is the widget's associated backing framebuffer, not the platform-specific one belonging to the top-level window's surface. This ensures the expected behavior for this function and other classes relying on it (for example, QOpenGLFramebufferObject::bindDefault() or QOpenGLFramebufferObject::release()).

See also QOpenGLFramebufferObject.

pub unsafe fn done_current(&mut self)[src]

Convenience function for calling makeCurrent with a 0 surface.

Calls C++ function: void QOpenGLContext::doneCurrent().

C++ documentation:

Convenience function for calling makeCurrent with a 0 surface.

This results in no context being current in the current thread.

See also makeCurrent() and currentContext().

pub unsafe fn extensions(&self) -> CppBox<QSetOfQByteArray>[src]

Returns the set of OpenGL extensions supported by this context.

Calls C++ function: QSet<QByteArray> QOpenGLContext::extensions() const.

C++ documentation:

Returns the set of OpenGL extensions supported by this context.

The context or a sharing context must be current.

See also hasExtension().

pub unsafe fn extra_functions(&self) -> MutPtr<QOpenGLExtraFunctions>[src]

Get the QOpenGLExtraFunctions instance for this context.

Calls C++ function: QOpenGLExtraFunctions* QOpenGLContext::extraFunctions() const.

C++ documentation:

Get the QOpenGLExtraFunctions instance for this context.

QOpenGLContext offers this as a convenient way to access QOpenGLExtraFunctions without having to manage it manually.

The context or a sharing context must be current.

The returned QOpenGLExtraFunctions instance is ready to be used and it does not need initializeOpenGLFunctions() to be called.

Note: QOpenGLExtraFunctions contains functionality that is not guaranteed to be available at runtime. Runtime availability depends on the platform, graphics driver, and the OpenGL version requested by the application.

See also QOpenGLFunctions and QOpenGLExtraFunctions.

pub unsafe fn format(&self) -> CppBox<QSurfaceFormat>[src]

Returns the format of the underlying platform context, if create() has been called.

Calls C++ function: QSurfaceFormat QOpenGLContext::format() const.

C++ documentation:

Returns the format of the underlying platform context, if create() has been called.

Otherwise, returns the requested format.

The requested and the actual format may differ. Requesting a given OpenGL version does not mean the resulting context will target exactly the requested version. It is only guaranteed that the version/profile/options combination for the created context is compatible with the request, as long as the driver is able to provide such a context.

For example, requesting an OpenGL version 3.x core profile context may result in an OpenGL 4.x core profile context. Similarly, a request for OpenGL 2.1 may result in an OpenGL 3.0 context with deprecated functions enabled. Finally, depending on the driver, unsupported versions may result in either a context creation failure or in a context for the highest supported version.

Similar differences are possible in the buffer sizes, for example, the resulting context may have a larger depth buffer than requested. This is perfectly normal.

See also setFormat().

pub unsafe fn functions(&self) -> MutPtr<QOpenGLFunctions>[src]

Get the QOpenGLFunctions instance for this context.

Calls C++ function: QOpenGLFunctions* QOpenGLContext::functions() const.

C++ documentation:

Get the QOpenGLFunctions instance for this context.

QOpenGLContext offers this as a convenient way to access QOpenGLFunctions without having to manage it manually.

The context or a sharing context must be current.

The returned QOpenGLFunctions instance is ready to be used and it does not need initializeOpenGLFunctions() to be called.

pub unsafe fn get_proc_address_q_byte_array(
    &self,
    proc_name: impl CastInto<Ref<QByteArray>>
) -> Option<extern "C" fn()>
[src]

Resolves the function pointer to an OpenGL extension function, identified by procName

Calls C++ function: void (*FN_PTR)() QOpenGLContext::getProcAddress(const QByteArray& procName) const.

C++ documentation:

Resolves the function pointer to an OpenGL extension function, identified by procName

Returns 0 if no such function can be found.

pub unsafe fn get_proc_address_char(
    &self,
    proc_name: impl CastInto<Ptr<c_char>>
) -> Option<extern "C" fn()>
[src]

This is an overloaded function.

Calls C++ function: void (*FN_PTR)() QOpenGLContext::getProcAddress(const char* procName) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.8.

pub unsafe fn global_share_context() -> MutPtr<QOpenGLContext>[src]

Returns the application-wide shared OpenGL context, if present. Otherwise, returns a null pointer.

Calls C++ function: static QOpenGLContext* QOpenGLContext::globalShareContext().

C++ documentation:

Returns the application-wide shared OpenGL context, if present. Otherwise, returns a null pointer.

This is useful if you need to upload OpenGL objects (buffers, textures, etc.) before creating or showing a QOpenGLWidget or QQuickWidget.

Note: You must set the Qt::AA_ShareOpenGLContexts flag on QGuiApplication before creating the QGuiApplication object, otherwise Qt may not create a global shared context.

Warning: Do not attempt to make the context returned by this function current on any surface. Instead, you can create a new context which shares with the global one, and then make the new context current.

This function was introduced in Qt 5.5.

See also Qt::AA_ShareOpenGLContexts, setShareContext(), and makeCurrent().

pub unsafe fn has_extension(
    &self,
    extension: impl CastInto<Ref<QByteArray>>
) -> bool
[src]

Returns true if this OpenGL context supports the specified OpenGL extension, false otherwise.

Calls C++ function: bool QOpenGLContext::hasExtension(const QByteArray& extension) const.

C++ documentation:

Returns true if this OpenGL context supports the specified OpenGL extension, false otherwise.

The context or a sharing context must be current.

See also extensions().

pub unsafe fn is_opengl_e_s(&self) -> bool[src]

Returns true if the context is an OpenGL ES context.

Calls C++ function: bool QOpenGLContext::isOpenGLES() const.

C++ documentation:

Returns true if the context is an OpenGL ES context.

If the context has not yet been created, the result is based on the requested format set via setFormat().

This function was introduced in Qt 5.3.

See also create(), format(), and setFormat().

pub unsafe fn is_valid(&self) -> bool[src]

Returns if this context is valid, i.e. has been successfully created.

Calls C++ function: bool QOpenGLContext::isValid() const.

C++ documentation:

Returns if this context is valid, i.e. has been successfully created.

On some platforms the return value of false for a context that was successfully created previously indicates that the OpenGL context was lost.

The typical way to handle context loss scenarios in applications is to check via this function whenever makeCurrent() fails and returns false. If this function then returns false, recreate the underlying native OpenGL context by calling create(), call makeCurrent() again and then reinitialize all OpenGL resources.

See also create().

pub unsafe fn make_current(
    &mut self,
    surface: impl CastInto<MutPtr<QSurface>>
) -> bool
[src]

Makes the context current in the current thread, against the given surface. Returns true if successful; otherwise returns false. The latter may happen if the surface is not exposed, or the graphics hardware is not available due to e.g. the application being suspended.

Calls C++ function: bool QOpenGLContext::makeCurrent(QSurface* surface).

C++ documentation:

Makes the context current in the current thread, against the given surface. Returns true if successful; otherwise returns false. The latter may happen if the surface is not exposed, or the graphics hardware is not available due to e.g. the application being suspended.

If surface is 0 this is equivalent to calling doneCurrent().

Avoid calling this function from a different thread than the one the QOpenGLContext instance lives in. If you wish to use QOpenGLContext from a different thread you should first call make sure it's not current in the current thread, by calling doneCurrent() if necessary. Then call moveToThread(otherThread) before using it in the other thread.

By default Qt employs a check that enforces the above condition on the thread affinity. It is still possible to disable this check by setting the Qt::AA_DontCheckOpenGLContextThreadAffinity application attribute. Be sure to understand the consequences of using QObjects from outside the thread they live in, as explained in the QObject thread affinity documentation.

See also functions(), doneCurrent(), and Qt::AA_DontCheckOpenGLContextThreadAffinity.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QOpenGLContext::metaObject() const.

pub unsafe fn native_handle(&self) -> CppBox<QVariant>[src]

Returns the native handle for the context.

Calls C++ function: QVariant QOpenGLContext::nativeHandle() const.

C++ documentation:

Returns the native handle for the context.

This function provides access to the QOpenGLContext's underlying native context. The returned variant contains a platform-specific value type. These classes can be found in the module QtPlatformHeaders.

On platforms where retrieving the native handle is not supported, or if neither create() nor setNativeHandle() was called, a null variant is returned.

This function was introduced in Qt 5.4.

See also setNativeHandle().

pub unsafe fn new_1a(
    parent: impl CastInto<MutPtr<QObject>>
) -> CppBox<QOpenGLContext>
[src]

Creates a new OpenGL context instance with parent object parent.

Calls C++ function: [constructor] void QOpenGLContext::QOpenGLContext(QObject* parent = …).

C++ documentation:

Creates a new OpenGL context instance with parent object parent.

Before it can be used you need to set the proper format and call create().

See also create() and makeCurrent().

pub unsafe fn new_0a() -> CppBox<QOpenGLContext>[src]

The QOpenGLContext class represents a native OpenGL context, enabling OpenGL rendering on a QSurface.

Calls C++ function: [constructor] void QOpenGLContext::QOpenGLContext().

C++ documentation:

The QOpenGLContext class represents a native OpenGL context, enabling OpenGL rendering on a QSurface.

QOpenGLContext represents the OpenGL state of an underlying OpenGL context. To set up a context, set its screen and format such that they match those of the surface or surfaces with which the context is meant to be used, if necessary make it share resources with other contexts with setShareContext(), and finally call create(). Use the return value or isValid() to check if the context was successfully initialized.

A context can be made current against a given surface by calling makeCurrent(). When OpenGL rendering is done, call swapBuffers() to swap the front and back buffers of the surface, so that the newly rendered content becomes visible. To be able to support certain platforms, QOpenGLContext requires that you call makeCurrent() again before starting rendering a new frame, after calling swapBuffers().

If the context is temporarily not needed, such as when the application is not rendering, it can be useful to delete it in order to free resources. You can connect to the aboutToBeDestroyed() signal to clean up any resources that have been allocated with different ownership from the QOpenGLContext itself.

Once a QOpenGLContext has been made current, you can render to it in a platform independent way by using Qt's OpenGL enablers such as QOpenGLFunctions, QOpenGLBuffer, QOpenGLShaderProgram, and QOpenGLFramebufferObject. It is also possible to use the platform's OpenGL API directly, without using the Qt enablers, although potentially at the cost of portability. The latter is necessary when wanting to use OpenGL 1.x or OpenGL ES 1.x.

For more information about the OpenGL API, refer to the official OpenGL documentation.

For an example of how to use QOpenGLContext see the OpenGL Window example.

pub unsafe fn opengl_module_handle() -> MutPtr<c_void>[src]

Returns the platform-specific handle for the OpenGL implementation that is currently in use. (for example, a HMODULE on Windows)

Calls C++ function: static void* QOpenGLContext::openGLModuleHandle().

C++ documentation:

Returns the platform-specific handle for the OpenGL implementation that is currently in use. (for example, a HMODULE on Windows)

On platforms that do not use dynamic GL switch the return value is null.

The library might be GL-only, meaning that windowing system interface functions (for example EGL) may live in another, separate library.

Note: This function requires that the QGuiApplication instance is already created.

This function was introduced in Qt 5.3.

See also openGLModuleType().

pub unsafe fn opengl_module_type() -> OpenGLModuleType[src]

Returns the underlying OpenGL implementation type.

Calls C++ function: static QOpenGLContext::OpenGLModuleType QOpenGLContext::openGLModuleType().

C++ documentation:

Returns the underlying OpenGL implementation type.

On platforms where the OpenGL implementation is not dynamically loaded, the return value is determined during compile time and never changes.

Note: A desktop OpenGL implementation may be capable of creating ES-compatible contexts too. Therefore in most cases it is more appropriate to check QSurfaceFormat::renderableType() or use the convenience function isOpenGLES().

Note: This function requires that the QGuiApplication instance is already created.

This function was introduced in Qt 5.3.

pub unsafe fn qt_metacall(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]

Calls C++ function: virtual int QOpenGLContext::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

Calls C++ function: virtual void* QOpenGLContext::qt_metacast(const char* arg1).

pub unsafe fn screen(&self) -> MutPtr<QScreen>[src]

Returns the screen the context was created for.

Calls C++ function: QScreen* QOpenGLContext::screen() const.

C++ documentation:

Returns the screen the context was created for.

See also setScreen().

pub unsafe fn set_format(&mut self, format: impl CastInto<Ref<QSurfaceFormat>>)[src]

Sets the format the OpenGL context should be compatible with. You need to call create() before it takes effect.

Calls C++ function: void QOpenGLContext::setFormat(const QSurfaceFormat& format).

C++ documentation:

Sets the format the OpenGL context should be compatible with. You need to call create() before it takes effect.

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 contexts, individual calls to this function can be replaced by one single call to QSurfaceFormat::setDefaultFormat() before creating the first context.

See also format().

pub unsafe fn set_native_handle(&mut self, handle: impl CastInto<Ref<QVariant>>)[src]

Set the native handles for this context. When create() is called and a native handle is set, configuration settings, like format(), are ignored since this QOpenGLContext will wrap an already created native context instead of creating a new one from scratch.

Calls C++ function: void QOpenGLContext::setNativeHandle(const QVariant& handle).

C++ documentation:

Set the native handles for this context. When create() is called and a native handle is set, configuration settings, like format(), are ignored since this QOpenGLContext will wrap an already created native context instead of creating a new one from scratch.

On some platforms the native context handle is not sufficient and other related handles (for example, for a window or display) have to be provided in addition. Therefore handle is variant containing a platform-specific value type. These classes can be found in the QtPlatformHeaders module.

When create() is called with native handles set, QOpenGLContext does not take ownership of the handles, so destroying the QOpenGLContext does not destroy the native context.

Note: Some frameworks track the current context and surfaces internally. Making the adopted QOpenGLContext current via Qt will have no effect on such other frameworks' internal state. Therefore a subsequent makeCurrent done via the other framework may have no effect. It is therefore advisable to make explicit calls to make no context and surface current to reset the other frameworks' internal state after performing OpenGL operations via Qt.

Note: Using foreign contexts with Qt windows and Qt contexts with windows and surfaces created by other frameworks may give unexpected results, depending on the platform, due to potential mismatches in context and window pixel formats. To make sure this does not happen, avoid making contexts and surfaces from different frameworks current together. Instead, prefer approaches based on context sharing where OpenGL resources like textures are accessible both from Qt's and the foreign framework's contexts.

This function was introduced in Qt 5.4.

See also nativeHandle().

pub unsafe fn set_screen(&mut self, screen: impl CastInto<MutPtr<QScreen>>)[src]

Sets the screen the OpenGL context should be valid for. You need to call create() before it takes effect.

Calls C++ function: void QOpenGLContext::setScreen(QScreen* screen).

C++ documentation:

Sets the screen the OpenGL context should be valid for. You need to call create() before it takes effect.

See also screen().

pub unsafe fn set_share_context(
    &mut self,
    share_context: impl CastInto<MutPtr<QOpenGLContext>>
)
[src]

Makes this context share textures, shaders, and other OpenGL resources with shareContext. You need to call create() before it takes effect.

Calls C++ function: void QOpenGLContext::setShareContext(QOpenGLContext* shareContext).

C++ documentation:

Makes this context share textures, shaders, and other OpenGL resources with shareContext. You need to call create() before it takes effect.

See also shareContext().

pub unsafe fn share_context(&self) -> MutPtr<QOpenGLContext>[src]

Returns the share context this context was created with.

Calls C++ function: QOpenGLContext* QOpenGLContext::shareContext() const.

C++ documentation:

Returns the share context this context was created with.

If the underlying platform was not able to support the requested sharing, this will return 0.

See also setShareContext().

pub unsafe fn share_group(&self) -> MutPtr<QOpenGLContextGroup>[src]

Returns the share group this context belongs to.

Calls C++ function: QOpenGLContextGroup* QOpenGLContext::shareGroup() const.

C++ documentation:

Returns the share group this context belongs to.

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn supports_threaded_opengl() -> bool[src]

Returns true if the platform supports OpenGL rendering outside the main (gui) thread.

Calls C++ function: static bool QOpenGLContext::supportsThreadedOpenGL().

C++ documentation:

Returns true if the platform supports OpenGL rendering outside the main (gui) thread.

The value is controlled by the platform plugin in use and may also depend on the graphics drivers.

This function was introduced in Qt 5.5.

pub unsafe fn surface(&self) -> MutPtr<QSurface>[src]

Returns the surface the context has been made current with.

Calls C++ function: QSurface* QOpenGLContext::surface() const.

C++ documentation:

Returns the surface the context has been made current with.

This is the surface passed as an argument to makeCurrent().

pub unsafe fn swap_buffers(&mut self, surface: impl CastInto<MutPtr<QSurface>>)[src]

Swap the back and front buffers of surface.

Calls C++ function: void QOpenGLContext::swapBuffers(QSurface* surface).

C++ documentation:

Swap the back and front buffers of surface.

Call this to finish a frame of OpenGL rendering, and make sure to call makeCurrent() again before you begin a new frame.

pub unsafe fn tr(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QOpenGLContext::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QOpenGLContext::trUtf8(const char* s, const char* c, int n).

pub unsafe fn version_functions_1a(
    &self,
    version_profile: impl CastInto<Ref<QOpenGLVersionProfile>>
) -> MutPtr<QAbstractOpenGLFunctions>
[src]

Returns a pointer to an object that provides access to all functions for the versionProfile of this context. There is no need to call QAbstractOpenGLFunctions::initializeOpenGLFunctions() as long as this context is current. It is also possible to call this function when the context is not current, but in that case it is the caller's responsibility to ensure proper initialization by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions() afterwards.

Calls C++ function: QAbstractOpenGLFunctions* QOpenGLContext::versionFunctions(const QOpenGLVersionProfile& versionProfile = …) const.

C++ documentation:

Returns a pointer to an object that provides access to all functions for the versionProfile of this context. There is no need to call QAbstractOpenGLFunctions::initializeOpenGLFunctions() as long as this context is current. It is also possible to call this function when the context is not current, but in that case it is the caller's responsibility to ensure proper initialization by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions() afterwards.

Usually one would use the template version of this function to automatically have the result cast to the correct type.

pub unsafe fn version_functions_0a(&self) -> MutPtr<QAbstractOpenGLFunctions>[src]

Returns a pointer to an object that provides access to all functions for the versionProfile of this context. There is no need to call QAbstractOpenGLFunctions::initializeOpenGLFunctions() as long as this context is current. It is also possible to call this function when the context is not current, but in that case it is the caller's responsibility to ensure proper initialization by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions() afterwards.

Calls C++ function: QAbstractOpenGLFunctions* QOpenGLContext::versionFunctions() const.

C++ documentation:

Returns a pointer to an object that provides access to all functions for the versionProfile of this context. There is no need to call QAbstractOpenGLFunctions::initializeOpenGLFunctions() as long as this context is current. It is also possible to call this function when the context is not current, but in that case it is the caller's responsibility to ensure proper initialization by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions() afterwards.

Usually one would use the template version of this function to automatically have the result cast to the correct type.

Trait Implementations

impl CppDeletable for QOpenGLContext[src]

unsafe fn delete(&mut self)[src]

Destroys the QOpenGLContext object.

Calls C++ function: virtual [destructor] void QOpenGLContext::~QOpenGLContext().

C++ documentation:

Destroys the QOpenGLContext object.

If this is the current context for the thread, doneCurrent() is also called.

impl Deref for QOpenGLContext[src]

type Target = QObject

The resulting type after dereferencing.

fn deref(&self) -> &QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QOpenGLContext* ptr).

impl DerefMut for QOpenGLContext[src]

fn deref_mut(&mut self) -> &mut QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QOpenGLContext* ptr).

impl DynamicCast<QOpenGLContext> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QOpenGLContext>[src]

Calls C++ function: QOpenGLContext* dynamic_cast<QOpenGLContext*>(QObject* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<QOpenGLContext>[src]

Calls C++ function: QOpenGLContext* dynamic_cast<QOpenGLContext*>(QObject* ptr).

impl StaticDowncast<QOpenGLContext> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QOpenGLContext>[src]

Calls C++ function: QOpenGLContext* static_cast<QOpenGLContext*>(QObject* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QObject>) -> MutPtr<QOpenGLContext>[src]

Calls C++ function: QOpenGLContext* static_cast<QOpenGLContext*>(QObject* ptr).

impl StaticUpcast<QObject> for QOpenGLContext[src]

unsafe fn static_upcast(ptr: Ptr<QOpenGLContext>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QOpenGLContext* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QOpenGLContext>) -> MutPtr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QOpenGLContext* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.