summaryrefslogtreecommitdiff
path: root/examples/quick
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-03-20 15:47:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-24 22:27:21 +0100
commit76dd99c448ae69cb12a0465facc5dd743b94e624 (patch)
tree785288589e8645a42be240960e75a6ff718faf64 /examples/quick
parent51156e412b2f91dbbf8c0b6055e6ab4c29370d8a (diff)
downloadqtquickcontrols-76dd99c448ae69cb12a0465facc5dd743b94e624.tar.gz
Fix shaders for OpenGL core profiles
Add also a --coreprofile command-line parameter to the gallery and systemdialogs examples to allow testing Quick Controls with an OpenGL 3.2+ core profile. This depends on the new features introduced to qtdeclarative in I75a47182 and I41b513e9. Change-Id: I408263a108a71df221943915849a4c3e18e0d3e4 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/controls/gallery/src/main.cpp8
-rw-r--r--examples/quick/dialogs/systemdialogs/main.cpp8
2 files changed, 16 insertions, 0 deletions
diff --git a/examples/quick/controls/gallery/src/main.cpp b/examples/quick/controls/gallery/src/main.cpp
index a757f485..b0d12b85 100644
--- a/examples/quick/controls/gallery/src/main.cpp
+++ b/examples/quick/controls/gallery/src/main.cpp
@@ -40,10 +40,18 @@
#include "qtquickcontrolsapplication.h"
#include <QtQml/QQmlApplicationEngine>
+#include <QtGui/QSurfaceFormat>
+#include <QtQuick/QQuickWindow>
int main(int argc, char *argv[])
{
QtQuickControlsApplication app(argc, argv);
+ if (QCoreApplication::arguments().contains(QLatin1String("--coreprofile"))) {
+ QSurfaceFormat fmt = QQuickWindow::defaultFormat();
+ fmt.setVersion(4, 4);
+ fmt.setProfile(QSurfaceFormat::CoreProfile);
+ QQuickWindow::setDefaultFormat(fmt);
+ }
QQmlApplicationEngine engine(QUrl("qrc:/main.qml"));
return app.exec();
}
diff --git a/examples/quick/dialogs/systemdialogs/main.cpp b/examples/quick/dialogs/systemdialogs/main.cpp
index fd882200..6d0fef3c 100644
--- a/examples/quick/dialogs/systemdialogs/main.cpp
+++ b/examples/quick/dialogs/systemdialogs/main.cpp
@@ -40,10 +40,18 @@
#include "qtquickcontrolsapplication.h"
#include <QtQml/QQmlApplicationEngine>
+#include <QtGui/QSurfaceFormat>
+#include <QtQuick/QQuickWindow>
int main(int argc, char *argv[])
{
QtQuickControlsApplication app(argc, argv);
+ if (QCoreApplication::arguments().contains(QLatin1String("--coreprofile"))) {
+ QSurfaceFormat fmt = QQuickWindow::defaultFormat();
+ fmt.setVersion(4, 4);
+ fmt.setProfile(QSurfaceFormat::CoreProfile);
+ QQuickWindow::setDefaultFormat(fmt);
+ }
QQmlApplicationEngine engine(QUrl("qrc:/dialogs/systemdialogs/systemdialogs.qml"));
return app.exec();
}