diff options
author | Shawn Rutledge <[email protected]> | 2022-01-21 09:55:50 +0100 |
---|---|---|
committer | Shawn Rutledge <[email protected]> | 2022-01-21 15:29:56 +0000 |
commit | 3fc68053db3acd9f7bef23d3aef1f7ac874e73dc (patch) | |
tree | bd88dce3581bf41e2596072eb1dd170eb210db33 /src/quick/util/qquickstategroup.cpp | |
parent | 44ca135c5a4d02ab29b57a3f15b84850aafb1cec (diff) |
Use qt.qml.states logging category instead of STATECHANGE_DEBUG env
- It should not be a warning: it's for debugging.
- It's nice to have the logging category instead of "default" in case
you have %{category} in your QT_MESSAGE_PATTERN.
- The env var didn't even have QT or QML in it.
[ChangeLog][QtQml] The new qt.qml.states logging category is useful
for debugging states and transitions. It replaces the STATECHANGE_DEBUG
environment variable.
Task-number: QTBUG-100117
Pick-to: 6.3
Change-Id: If67e21488a66867645f3a395941fcc92d3ea7bbb
Reviewed-by: Ulf Hermann <[email protected]>
Diffstat (limited to 'src/quick/util/qquickstategroup.cpp')
-rw-r--r-- | src/quick/util/qquickstategroup.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/quick/util/qquickstategroup.cpp b/src/quick/util/qquickstategroup.cpp index b86333943c..d664b67485 100644 --- a/src/quick/util/qquickstategroup.cpp +++ b/src/quick/util/qquickstategroup.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE -DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG); +Q_DECLARE_LOGGING_CATEGORY(lcStates) class QQuickStateGroupPrivate : public QObjectPrivate { @@ -377,8 +377,7 @@ bool QQuickStateGroupPrivate::updateAutoState() if (state->isWhenKnown()) { if (state->isNamed()) { if (state->when()) { - if (stateChangeDebug()) - qWarning() << "Setting auto state due to expression"; + qCDebug(lcStates) << "Setting auto state due to expression"; if (currentState != state->name()) { q->setState(state->name()); return true; @@ -483,11 +482,11 @@ void QQuickStateGroupPrivate::setCurrentStateInternal(const QString &state, applyingState = true; QQuickTransition *transition = ignoreTrans ? nullptr : findTransition(currentState, state); - if (stateChangeDebug()) { - qWarning() << this << "Changing state. From" << currentState << ". To" << state; + if (lcStates().isDebugEnabled()) { + qCDebug(lcStates) << this << "changing state from:" << currentState << "to:" << state; if (transition) - qWarning() << " using transition" << transition->fromState() - << transition->toState(); + qCDebug(lcStates) << " using transition" << transition->fromState() + << transition->toState(); } QQuickState *oldState = nullptr; |