aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-11-03 13:52:46 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2025-11-05 17:31:30 +0000
commit75d25e98c6c6a91ac0a51a941710c1509f13dbbb (patch)
tree03dc3108cf11d1bc5cafa85fc8cdf2fe82b25f71
parent3b11fba1497cdfe50f3200efd868c704b6feba38 (diff)
QtQml: Document QQmlDebuggingEnabler and enableDebugging()
Without this, the existing documentation for the other methods of QQmlDebuggingEnabler doesn't show up. Pick-to: 6.8 Change-Id: I97335271035294b7f65d9ac78b9cf0143896a6c3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 938e973270ebe9a039d7bed4747c45f3376d78b5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qml/debugger/qqmldebug.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/qml/debugger/qqmldebug.cpp b/src/qml/debugger/qqmldebug.cpp
index c063a5f586..c8b316d9a5 100644
--- a/src/qml/debugger/qqmldebug.cpp
+++ b/src/qml/debugger/qqmldebug.cpp
@@ -22,8 +22,39 @@ QT_BEGIN_NAMESPACE
# define Q_ATOMIC_FLAG_INIT ATOMIC_FLAG_INIT // deprecated in C++20
#endif
+/*!
+ \class QQmlDebuggingEnabler
+ \inmodule QtQml
+ \brief The QQmlDebuggingEnabler class provides methods to enable debugging or profiling.
+
+ Usually QML debugging and profiling is enabled by passing
+ \c{QT_ENABLE_QML_DEBUG} via CMake or \c{CONFIG+=qml_debug} via qmake when
+ building your application. At run time, the application generally parses
+ any \c{-qmljsdebugger} command line arguments to actually start debugging
+ or profiling.
+
+ You can instead handle these tasks manually by using the methods in this
+ class.
+ */
+
Q_CONSTINIT static std::atomic_flag s_printedWarning = Q_ATOMIC_FLAG_INIT;
+/*!
+ Enable debugging or profiling. If \a printWarning is \c{true}, print the
+ following warning to stderr:
+
+ \badcode
+ QML debugging is enabled. Only use this in a safe environment.
+ \endcode
+
+ This method is automatically called at startup if \c{QT_ENABLE_QML_DEBUG}
+ or \c{CONFIG+=qml_debug} is passed at build time.
+
+ This method needs to be called one way or another before starting a debug
+ connector of any kind. Otherwise the connector will refuse to start.
+
+ \sa startTcpDebugServer(), connectToLocalDebugger(), startDebugConnector()
+ */
void QQmlDebuggingEnabler::enableDebugging(bool printWarning)
{
if (printWarning && !s_printedWarning.test_and_set(std::memory_order_relaxed)) {
@@ -34,6 +65,9 @@ void QQmlDebuggingEnabler::enableDebugging(bool printWarning)
}
#if QT_DEPRECATED_SINCE(6, 4)
+/*!
+ \internal
+ */
QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning)
{
enableDebugging(printWarning);