From 007c876313dc70660cd032e79b84a9b27e0b6e68 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Wed, 11 Oct 2023 16:58:41 +0100 Subject: [PATCH] Add Show OpenGL Info debug option --- source/app/application.h | 4 ++++ source/app/ui/qml/main.qml | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/source/app/application.h b/source/app/application.h index edeb63d02..22a0af388 100644 --- a/source/app/application.h +++ b/source/app/application.h @@ -21,6 +21,8 @@ #include "updates/updater.h" +#include "rendering/openglfunctions.h" + #include "shared/iapplication.h" #include "shared/utils/qmlenum.h" #include "shared/utils/downloadqueue.h" @@ -135,6 +137,7 @@ class Application : public QObject, public IApplication Q_PROPERTY(QStringList arguments READ arguments CONSTANT) Q_PROPERTY(QStringList environment READ environment CONSTANT) + Q_PROPERTY(QString openGLInfo READ openGLInfo CONSTANT) Q_PROPERTY(QStringList nameFilters READ nameFilters NOTIFY nameFiltersChanged) Q_PROPERTY(QStringListModel* loadableExtensions READ loadableExtensions NOTIFY loadableExtensionsChanged) @@ -168,6 +171,7 @@ class Application : public QObject, public IApplication static QStringList arguments() { return QCoreApplication::arguments(); } static QStringList environment() { return QProcessEnvironment::systemEnvironment().toStringList(); } + static QString openGLInfo() { return OpenGLFunctions::info(); } Q_INVOKABLE bool canOpen(const QString& urlTypeName) const; Q_INVOKABLE bool canOpenAnyOf(const QStringList& urlTypeNames) const; diff --git a/source/app/ui/qml/main.qml b/source/app/ui/qml/main.qml index af819c150..99c1a6c10 100644 --- a/source/app/ui/qml/main.qml +++ b/source/app/ui/qml/main.qml @@ -469,6 +469,12 @@ ApplicationWindow text: mainWindow.environment } + TextDialog + { + id: openGLInfoDialog + text: application.openGLInfo + } + ShowPaletteDialog { id: showPaletteDialog } TextDialog @@ -1872,6 +1878,13 @@ ApplicationWindow onTriggered: function(source) { environmentDialog.show(); } } + Action + { + id: showOpenGLInfoAction + text: qsTr("Show OpenGL Info") + onTriggered: function(source) { openGLInfoDialog.show(); } + } + Action { id: showPaletteAction @@ -2444,6 +2457,7 @@ ApplicationWindow PlatformMenuItem { action: reportScopeTimersAction } PlatformMenuItem { action: showCommandLineArgumentsAction } PlatformMenuItem { action: showEnvironmentAction } + PlatformMenuItem { action: showOpenGLInfoAction } PlatformMenuItem { action: showPaletteAction } PlatformMenuItem { action: testCommandAction } PlatformMenuItem { action: testInfiniteParseAction }