diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-03-19 15:43:49 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-20 15:51:45 +0100 |
commit | d8fb0b485a604d690504df5b44feaeba5325dd60 (patch) | |
tree | 40783d45bc47b117a61107e9ba47df647aad6568 /src/quick/items/qquickwindow.h | |
parent | a122617ac110c1d98dbf2bbde1b1b4a8d6a2ee0b (diff) |
Add defaultSurfaceFormat to QQuickWindow
This static function can be used to set a surface format that is
then picked up by all QQuickWindows, including the ones instantiated
from QML.
This introduces the ability to request higher OpenGL versions, core
profile and other options also for windows that are created from QML
via the ApplicationWindow element in Quick Controls applications.
[ChangeLog] Added QQuickWindow::setDefaultSurfaceFormat() to
set a surface format that applies to all Quick windows,
including the ones created from QML. The OpenGL shading language
version is now exposed to QML too in order to allow components
to provide the correct shader source so shader effect items.
Task-number: QTBUG-36392
Change-Id: I75a4718243d835894461f7ee0b4a383988840f9b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quick/items/qquickwindow.h')
-rw-r--r-- | src/quick/items/qquickwindow.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h index 2572f31375..1a4adb0785 100644 --- a/src/quick/items/qquickwindow.h +++ b/src/quick/items/qquickwindow.h @@ -67,6 +67,8 @@ class Q_QUICK_EXPORT QQuickWindow : public QWindow Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(QQuickItem* contentItem READ contentItem CONSTANT) Q_PROPERTY(QQuickItem* activeFocusItem READ activeFocusItem NOTIFY activeFocusItemChanged REVISION 1) + Q_PROPERTY(QString glslVersion READ glslVersion CONSTANT REVISION 2) + Q_PROPERTY(bool glslIsCoreProfile READ glslIsCoreProfile CONSTANT REVISION 2) Q_CLASSINFO("DefaultProperty", "data") Q_DECLARE_PRIVATE(QQuickWindow) public: @@ -136,6 +138,12 @@ public: QOpenGLContext *openglContext() const; + static void setDefaultFormat(const QSurfaceFormat &format); + static QSurfaceFormat defaultFormat(); + + QString glslVersion() const; + bool glslIsCoreProfile() const; + Q_SIGNALS: void frameSwapped(); Q_REVISION(2) void openglContextCreated(QOpenGLContext *context); |