diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-05-27 10:21:14 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-06-02 00:42:51 +0000 |
| commit | 7bfbd706b56c426e2683e519543b56426310520f (patch) | |
| tree | 37e64901634cf65cd988be2f511c87bf2a8824b3 /src/qml/debugger/qqmldebug.cpp | |
| parent | 130eafa75bed2c4f0c72e2f4e4402b86837e153f (diff) | |
qqmldebug.h: Wrap the QML debugging enabler into an unnamed namespace
This way compilers will hopefully not complain about the use of global
constructors anymore. It's clear now that we want a separate
QQmlDebuggingEnabler for each CU.
Change-Id: Ief8e748a87612c04a8ca9a8535f10d905675b918
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/qml/debugger/qqmldebug.cpp')
| -rw-r--r-- | src/qml/debugger/qqmldebug.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/debugger/qqmldebug.cpp b/src/qml/debugger/qqmldebug.cpp index 4044612793..c5f0555242 100644 --- a/src/qml/debugger/qqmldebug.cpp +++ b/src/qml/debugger/qqmldebug.cpp @@ -59,13 +59,18 @@ QT_BEGIN_NAMESPACE Q_CONSTINIT static std::atomic_flag s_printedWarning = Q_ATOMIC_FLAG_INIT; -QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning) +void QQmlDebuggingEnabler::enableDebugging(bool printWarning) { if (printWarning && !s_printedWarning.test_and_set(std::memory_order_relaxed)) fprintf(stderr, "QML debugging is enabled. Only use this in a safe environment.\n"); QQmlEnginePrivate::qml_debugging_enabled.store(true, std::memory_order_relaxed); } +QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning) +{ + enableDebugging(printWarning); +}; + /*! * Retrieves the plugin keys of the debugger services provided by default. The debugger services * enable a debug client to use a Qml/JavaScript debugger, in order to set breakpoints, pause |
