diff options
Diffstat (limited to 'examples/opengl/threadedqopenglwidget/main.cpp')
-rw-r--r-- | examples/opengl/threadedqopenglwidget/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/opengl/threadedqopenglwidget/main.cpp b/examples/opengl/threadedqopenglwidget/main.cpp index 975def030bf..2553d7754bb 100644 --- a/examples/opengl/threadedqopenglwidget/main.cpp +++ b/examples/opengl/threadedqopenglwidget/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -51,8 +51,10 @@ #include <QApplication> #include <QMainWindow> #include <QScreen> +#include <QShortcut> #include <QSurfaceFormat> #include <QOpenGLContext> +#include <QOpenGLFunctions> #include <QCommandLineParser> #include <QCommandLineOption> #include "mainwindow.h" @@ -95,6 +97,8 @@ int main( int argc, char ** argv ) topLevelGlWidget.resize(200, 200); topLevelGlWidget.move(pos); topLevelGlWidget.show(); + auto *closeShortcut = new QShortcut(Qt::CTRL | Qt::Key_Q, &a, QApplication::closeAllWindows); + closeShortcut->setContext(Qt::ApplicationShortcut); const QString glInfo = getGlString(topLevelGlWidget.context()->functions(), GL_VENDOR) + QLatin1Char('/') + getGlString(topLevelGlWidget.context()->functions(), GL_RENDERER); |