summaryrefslogtreecommitdiffstats
path: root/examples/opengl/paintedwindow/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/paintedwindow/main.cpp')
-rw-r--r--examples/opengl/paintedwindow/main.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/opengl/paintedwindow/main.cpp b/examples/opengl/paintedwindow/main.cpp
new file mode 100644
index 0000000000..345cea7bc5
--- /dev/null
+++ b/examples/opengl/paintedwindow/main.cpp
@@ -0,0 +1,23 @@
+#include <QGuiApplication>
+#include <QRect>
+#include <QScreen>
+
+#include "paintedwindow.h"
+
+int main(int argc, char **argv)
+{
+ QGuiApplication app(argc, argv);
+
+ QScreen *screen = QGuiApplication::primaryScreen();
+
+ QRect screenGeometry = screen->availableGeometry();
+
+ QPoint center = screenGeometry.center();
+ QRect windowRect(0, 0, 640, 480);
+
+ PaintedWindow window;
+ window.setGeometry(QRect(center - windowRect.center(), windowRect.size()));
+ window.show();
+
+ app.exec();
+}