summaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellogl/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/hellogl/main.cpp')
-rw-r--r--examples/opengl/hellogl/main.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/opengl/hellogl/main.cpp b/examples/opengl/hellogl/main.cpp
index e645dba..f610b3b 100644
--- a/examples/opengl/hellogl/main.cpp
+++ b/examples/opengl/hellogl/main.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include <QApplication>
+#include <QDesktopWidget>
#include "window.h"
@@ -47,6 +48,13 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
- window.show();
+ window.resize(window.sizeHint());
+ int desktopArea = QApplication::desktop()->width() *
+ QApplication::desktop()->height();
+ int widgetArea = window.width() * window.height();
+ if (((float)widgetArea / (float)desktopArea) < 0.75f)
+ window.show();
+ else
+ window.showMaximized();
return app.exec();
}