diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-17 17:39:30 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-18 10:22:58 +0200 |
commit | d62f11f1d04851ac07491aa3994e20607b2e2adc (patch) | |
tree | 0626049efacc05996b429477378d7bf3212dcc3f /src/quick/scenegraph/qsgrhisupport.cpp | |
parent | b916c1bffdd4bcaaa6d4d75d2a9efa34a485cff5 (diff) |
Only enable opting in to rhi profiling when qml debugging is enabled
For security reasons, QML debugging (e.g. QML Profiler) is only usable
when the application had CONFIG+=qml_debug set. Follow the same approach
in the QRhi profiling infrastructure and do nothing if this was not set.
Change-Id: I46ea78a118d79e166a40722befbfc9263aac6680
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgrhisupport.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgrhisupport.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp index 86c2ea7806..007739d2d7 100644 --- a/src/quick/scenegraph/qsgrhisupport.cpp +++ b/src/quick/scenegraph/qsgrhisupport.cpp @@ -52,6 +52,8 @@ #include <QOperatingSystemVersion> #include <QOffscreenSurface> +#include <QtQml/private/qqmlengine_p.h> + QT_BEGIN_NAMESPACE #if QT_CONFIG(vulkan) @@ -737,6 +739,11 @@ void QSGRhiProfileConnection::initialize(QRhi *rhi) #ifdef RHI_REMOTE_PROFILER const QString profHost = qEnvironmentVariable("QSG_RHI_PROFILE_HOST"); if (!profHost.isEmpty()) { + if (!QQmlEnginePrivate::qml_debugging_enabled) { + qWarning("RHI profiling cannot be enabled without QML debugging, for security reasons. " + "Set CONFIG+=qml_debug in the application project."); + return; + } int profPort = qEnvironmentVariableIntValue("QSG_RHI_PROFILE_PORT"); if (!profPort) profPort = 30667; |