aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickstategroup.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2023-06-28 14:16:06 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2023-06-29 09:14:00 +0200
commit6a074d57ce28a9514a116f71f77e3c4f18ed61e9 (patch)
treecfa5e460b912884781b7db54a2289e3865f886df /src/quick/util/qquickstategroup.cpp
parent52fcaec65d0a13831b0b8c75957c58235d6fdcc4 (diff)
Replace qobject_cast with static_cast
Since we don't check the return value of the qobject_cast anyway, and since we use static_cast everywhere else, don't waste time with the qobject_cast in replace_states and removeLast_states either. Pick-to: 6.6 Change-Id: I6025188e3f7f97f549ff7acc217c6fe905e31b91 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick/util/qquickstategroup.cpp')
-rw-r--r--src/quick/util/qquickstategroup.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/util/qquickstategroup.cpp b/src/quick/util/qquickstategroup.cpp
index b4be946dc3..d25caada00 100644
--- a/src/quick/util/qquickstategroup.cpp
+++ b/src/quick/util/qquickstategroup.cpp
@@ -174,7 +174,7 @@ void QQuickStateGroupPrivate::clear_states(QQmlListProperty<QQuickState> *list)
void QQuickStateGroupPrivate::replace_states(QQmlListProperty<QQuickState> *list, qsizetype index, QQuickState *state)
{
- auto *self = qobject_cast<QQuickStateGroup *>(list->object);
+ auto *self = static_cast<QQuickStateGroup *>(list->object);
auto *d = self->d_func();
auto *oldState = d->states.at(index);
if (oldState != state) {
@@ -188,7 +188,7 @@ void QQuickStateGroupPrivate::replace_states(QQmlListProperty<QQuickState> *list
void QQuickStateGroupPrivate::removeLast_states(QQmlListProperty<QQuickState> *list)
{
- auto *d = qobject_cast<QQuickStateGroup *>(list->object)->d_func();
+ auto *d = static_cast<QQuickStateGroup *>(list->object)->d_func();
if (d->currentState == d->states.last()->name())
d->setCurrentStateInternal(d->states.size() > 1 ? d->states.first()->name() : QString(), true);
d->states.last()->setStateGroup(nullptr);