diff options
author | hjk <qthjk@ovi.com> | 2012-12-19 11:27:10 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-28 20:44:55 +0100 |
commit | 0136252cb2973824b7f97abad1d4c3a4d9301178 (patch) | |
tree | 2e03b3946253216d6ce3a010d4155c36f3e834b7 /examples/opengl/hellowindow/main.cpp | |
parent | 4eac2c4728da85a5cdf91ec25170b3417f7deb68 (diff) |
Polish code of some opengl examples
Change-Id: If24ae1845176fc525cf6a239a5079f4802f8df3f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'examples/opengl/hellowindow/main.cpp')
-rw-r--r-- | examples/opengl/hellowindow/main.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/examples/opengl/hellowindow/main.cpp b/examples/opengl/hellowindow/main.cpp index 343160f755..e63b27d093 100644 --- a/examples/opengl/hellowindow/main.cpp +++ b/examples/opengl/hellowindow/main.cpp @@ -38,21 +38,22 @@ ** ****************************************************************************/ -#include <QGuiApplication> +#include "hellowindow.h" + #include <qpa/qplatformintegration.h> #include <private/qguiapplication_p.h> + +#include <QGuiApplication> #include <QScreen> #include <QThread> -#include "hellowindow.h" - -int main(int argc, char **argv) +int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); const bool multipleWindows = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL) - && !QGuiApplication::arguments().contains(QLatin1String("--single")); + && !QGuiApplication::arguments().contains(QStringLiteral("--single")); QScreen *screen = QGuiApplication::primaryScreen(); @@ -71,7 +72,7 @@ int main(int argc, char **argv) HelloWindow *windowA = new HelloWindow(rendererA); windowA->setGeometry(QRect(center, windowSize).translated(-windowSize.width() - delta / 2, 0)); - windowA->setTitle(QLatin1String("Thread A - Context A")); + windowA->setTitle(QStringLiteral("Thread A - Context A")); windowA->setVisible(true); windows.prepend(windowA); @@ -85,13 +86,13 @@ int main(int argc, char **argv) HelloWindow *windowB = new HelloWindow(rendererA); windowB->setGeometry(QRect(center, windowSize).translated(delta / 2, 0)); - windowB->setTitle(QLatin1String("Thread A - Context A")); + windowB->setTitle(QStringLiteral("Thread A - Context A")); windowB->setVisible(true); windows.prepend(windowB); HelloWindow *windowC = new HelloWindow(rendererB); windowC->setGeometry(QRect(center, windowSize).translated(-windowSize.width() / 2, windowSize.height() + delta)); - windowC->setTitle(QLatin1String("Thread B - Context B")); + windowC->setTitle(QStringLiteral("Thread B - Context B")); windowC->setVisible(true); windows.prepend(windowC); @@ -113,7 +114,7 @@ int main(int argc, char **argv) window->setGeometry(QRect(center, windowSize).translated(-windowSize.width() / 2, -windowSize.height() / 2)); QChar id = QChar('B' + i); - window->setTitle(QLatin1String("Thread ") + id + QLatin1String(" - Context ") + id); + window->setTitle(QStringLiteral("Thread ") + id + QStringLiteral(" - Context ") + id); window->setVisible(true); windows.prepend(window); } @@ -128,6 +129,7 @@ int main(int argc, char **argv) for (int i = 0; i < renderThreads.size(); ++i) renderThreads.at(i)->wait(); + qDeleteAll(windows); qDeleteAll(renderThreads); |