Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qopenglwindow.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOPENGLWINDOW_H
5#define QOPENGLWINDOW_H
6
7#include <QtOpenGL/qtopenglglobal.h>
8
9#ifndef QT_NO_OPENGL
10
11#include <QtGui/QPaintDeviceWindow>
12#include <QtGui/QOpenGLContext>
13#include <QtGui/QImage>
14
16
18
19class Q_OPENGL_EXPORT QOpenGLWindow : public QPaintDeviceWindow
20{
22 Q_DECLARE_PRIVATE(QOpenGLWindow)
23
24public:
28 PartialUpdateBlend
29 };
30
31 explicit QOpenGLWindow(UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = nullptr);
32 explicit QOpenGLWindow(QOpenGLContext *shareContext, UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = nullptr);
34
35 UpdateBehavior updateBehavior() const;
36 bool isValid() const;
37
38 void makeCurrent();
39 void doneCurrent();
40
41 QOpenGLContext *context() const;
42 QOpenGLContext *shareContext() const;
43
44 GLuint defaultFramebufferObject() const;
45
46 QImage grabFramebuffer();
47
50
51protected:
52 virtual void initializeGL();
53 virtual void resizeGL(int w, int h);
54 virtual void paintGL();
55 virtual void paintUnderGL();
56 virtual void paintOverGL();
57
58 void paintEvent(QPaintEvent *event) override;
59 void resizeEvent(QResizeEvent *event) override;
60 int metric(PaintDeviceMetric metric) const override;
61 QPaintDevice *redirected(QPoint *) const override;
62
63private:
64 Q_DISABLE_COPY(QOpenGLWindow)
65};
66
68
69#endif // QT_NO_OPENGL
70
71#endif
\inmodule QtGui
Definition qimage.h:37
\inmodule QtGui
\inmodule QtOpenGL
UpdateBehavior
This enum describes the update strategy of the QOpenGLWindow.
void frameSwapped()
This signal is emitted after the potentially blocking \l{QOpenGLContext::swapBuffers()}{buffer swap} ...
void paintEvent(QPaintEvent *event) override
Handles paint events passed in the event parameter.
int metric(PaintDeviceMetric metric) const override
virtual QPaintDevice * redirected(QPoint *offset) const
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:485
\inmodule QtCore\reentrant
Definition qpoint.h:23
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:547
\inmodule QtGui
Definition qwindow.h:63
virtual void resizeEvent(QResizeEvent *)
Override this to handle resize events (ev).
Definition qwindow.cpp:2384
void paintGL() override
[2]
Combined button and popup list for selecting options.
static void * context
GLfloat GLfloat GLfloat w
[0]
GLfloat GLfloat GLfloat GLfloat h
struct _cl_event * event
#define GLuint
#define Q_OBJECT
#define Q_SIGNALS
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent