diff options
Diffstat (limited to 'src/qml/types/qqmlconnections.cpp')
-rw-r--r-- | src/qml/types/qqmlconnections.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp index 4c44bba43e..29ed62cd39 100644 --- a/src/qml/types/qqmlconnections.cpp +++ b/src/qml/types/qqmlconnections.cpp @@ -47,6 +47,7 @@ #include <private/qqmlvmemetaobject_p.h> #include <qqmlinfo.h> +#include <QtCore/qloggingcategory.h> #include <QtCore/qdebug.h> #include <QtCore/qstringlist.h> @@ -54,6 +55,8 @@ QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(lcQmlConnections, "qt.qml.connections") + class QQmlConnectionsPrivate : public QObjectPrivate { public: @@ -276,8 +279,10 @@ void QQmlConnections::connectSignals() connectSignalsToMethods(); } else { #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) - qmlWarning(this) << tr("Implicitly defined onFoo properties in Connections are deprecated. " - "Use this syntax instead: function onFoo(<arguments>) { ... }"); + if (lcQmlConnections().isWarningEnabled()) { + qmlWarning(this) << tr("Implicitly defined onFoo properties in Connections are deprecated. " + "Use this syntax instead: function onFoo(<arguments>) { ... }"); + } #endif connectSignalsToBindings(); } |