Add QT_DECLARATIVE_DEBUG_NO_WARNING define to support enabling
the qml debugger without printing the usual startup warning.
This should be used with care, but e.g. for qmlscene the warning
probably confuses more than it helps.
Change-Id: I33704857baebfc8bca60abbff09138e259390b49
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
struct Q_QML_EXPORT QQmlDebuggingEnabler
{
- QQmlDebuggingEnabler();
+ QQmlDebuggingEnabler(bool printWarning = true);
};
// Execute code in constructor before first QQmlEngine is instantiated
-#if defined(QT_DECLARATIVE_DEBUG)
-static QQmlDebuggingEnabler qmlEnableDebuggingHelper;
+#if defined(QT_DECLARATIVE_DEBUG_NO_WARNING)
+static QQmlDebuggingEnabler qmlEnableDebuggingHelper(false);
+#elif defined(QT_DECLARATIVE_DEBUG)
+static QQmlDebuggingEnabler qmlEnableDebuggingHelper(true);
#endif
QT_END_NAMESPACE
return qmlAttachedPropertiesObjectById(*idCache, object, create);
}
-QQmlDebuggingEnabler::QQmlDebuggingEnabler()
+QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning)
{
#ifndef QQML_NO_DEBUG_PROTOCOL
- if (!QQmlEnginePrivate::qml_debugging_enabled) {
+ if (!QQmlEnginePrivate::qml_debugging_enabled
+ && printWarning) {
qDebug("QML debugging is enabled. Only use this in a safe environment.");
}
QQmlEnginePrivate::qml_debugging_enabled = true;
SOURCES += main.cpp
-CONFIG += console declarative_debug
+CONFIG += console
-DEFINES += QML_RUNTIME_TESTING
+DEFINES += QML_RUNTIME_TESTING QT_DECLARATIVE_DEBUG_NO_WARNING