Polish the HelloWindow example.

- Add window menu (enabling the close button on Windows)
- Query threaded Open GL capability.

Change-Id: I938f154e242dba584e2f597ac44294ab5d3b7141
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Friedemann Kleint 2011-11-28 11:32:39 +01:00 committed by Qt by Nokia
parent 45aa0a219a
commit 67e613963d
3 changed files with 7 additions and 3 deletions

View File

@ -62,7 +62,7 @@ HelloWindow::HelloWindow(Renderer *renderer)
, m_renderer(renderer)
{
setSurfaceType(QWindow::OpenGLSurface);
setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
setWindowFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
setGeometry(QRect(10, 10, 640, 480));

View File

@ -5,7 +5,7 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += gui-private core-private
# Input
HEADERS += hellowindow.h
SOURCES += hellowindow.cpp main.cpp

View File

@ -39,6 +39,8 @@
****************************************************************************/
#include <QGuiApplication>
#include <QPlatformIntegration>
#include <private/qguiapplication_p.h>
#include <QScreen>
#include <QThread>
@ -48,7 +50,9 @@ int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
bool multipleWindows = !QGuiApplication::arguments().contains(QLatin1String("--single"));
const bool multipleWindows =
QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)
&& !QGuiApplication::arguments().contains(QLatin1String("--single"));
QScreen *screen = QGuiApplication::primaryScreen();