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:
parent
45aa0a219a
commit
67e613963d
@ -62,7 +62,7 @@ HelloWindow::HelloWindow(Renderer *renderer)
|
|||||||
, m_renderer(renderer)
|
, m_renderer(renderer)
|
||||||
{
|
{
|
||||||
setSurfaceType(QWindow::OpenGLSurface);
|
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));
|
setGeometry(QRect(10, 10, 640, 480));
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
DEPENDPATH += .
|
DEPENDPATH += .
|
||||||
INCLUDEPATH += .
|
INCLUDEPATH += .
|
||||||
|
QT += gui-private core-private
|
||||||
# Input
|
# Input
|
||||||
HEADERS += hellowindow.h
|
HEADERS += hellowindow.h
|
||||||
SOURCES += hellowindow.cpp main.cpp
|
SOURCES += hellowindow.cpp main.cpp
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
#include <QPlatformIntegration>
|
||||||
|
#include <private/qguiapplication_p.h>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
@ -48,7 +50,9 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
QGuiApplication app(argc, 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();
|
QScreen *screen = QGuiApplication::primaryScreen();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user