From 5469d70418ab458dedcb572f42cf0839bacf210b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 11 Apr 2016 13:47:51 +0200 Subject: Fix some qdoc-warnings in 5.7. qtbase/src/corelib/global/qnamespace.qdoc:101: warning: Undocumented enum item 'AA_SynthesizeMouseForUnhandledTabletEvents' in Qt::ApplicationAttribute qtbase/src/corelib/global/qnamespace.qdoc:2554: warning: Undocumented enum item 'ImAnchorRectangle' in Qt::InputMethodQuery qtbase/src/corelib/statemachine/qsignaltransition.cpp:154: warning: Can't link to 'Q_COMPILER_DELEGATING_CONSTRUCTORS' qtbase/src/gui/image/qiconloader.cpp:160: warning: Cannot find 'QIconCacheGtkReader' specified with '\class' in any header file qtbase/src/gui/painting/qpaintengine_raster.cpp:1382: warning: No documentation for 'QRasterPaintEngine::fillPath(const QPainterPath &path, QSpanData *fillData)' qtbase/src/testlib/qtest.h:176: warning: No documentation for 'QTest::toString(const QHostAddress &addr)' qtbase/src/testlib/qtest_gui.h:77: warning: No documentation for 'QTest::toString(const QColor &color)' Change-Id: If9ac0807accf2530ec7fc2ca7db71a110f9f79bb Reviewed-by: Leena Miettinen Reviewed-by: Shawn Rutledge --- src/corelib/statemachine/qsignaltransition.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/corelib/statemachine') diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp index 9972487eb5..c4ba8e5315 100644 --- a/src/corelib/statemachine/qsignaltransition.cpp +++ b/src/corelib/statemachine/qsignaltransition.cpp @@ -159,9 +159,8 @@ QSignalTransition::QSignalTransition(const QObject *sender, const char *signal, Constructs a new signal transition associated with the given \a signal of the given \a sender object and with the given \a sourceState. - This constructor is enabled if compiler supports delegating constructor. - - \sa Q_COMPILER_DELEGATING_CONSTRUCTORS + This constructor is enabled if the compiler supports delegating constructors, + as indicated by the presence of the macro Q_COMPILER_DELEGATING_CONSTRUCTORS. */ /*! -- cgit v1.2.3 From f083830b8de106ed51d39242008215e9ea2179b2 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Wed, 13 Apr 2016 14:45:11 +0300 Subject: CoreLib: use const (and const APIs) more For CoW types const methods will be called. Mark store_persistent_indexes() as const, because this method does not modify the object. Change-Id: Ic867913b4fb5aaebfbaaffe1d3be45cf7b646403 Reviewed-by: Thiago Macieira --- src/corelib/statemachine/qhistorystate.cpp | 9 ++++++--- src/corelib/statemachine/qstatemachine.cpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/corelib/statemachine') diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp index c3361ad17e..338c89c688 100644 --- a/src/corelib/statemachine/qhistorystate.cpp +++ b/src/corelib/statemachine/qhistorystate.cpp @@ -209,6 +209,11 @@ QAbstractState *QHistoryState::defaultState() const return d->defaultTransition ? d->defaultTransition->targetState() : Q_NULLPTR; } +static inline bool isSoleEntry(const QList &states, const QAbstractState * state) +{ + return states.size() == 1 && states.first() == state; +} + /*! Sets this history state's default state to be the given \a state. \a state must be a sibling of this history state. @@ -224,9 +229,7 @@ void QHistoryState::setDefaultState(QAbstractState *state) "to this history state's group (%p)", state, parentState()); return; } - if (!d->defaultTransition - || d->defaultTransition->targetStates().size() != 1 - || d->defaultTransition->targetStates().first() != state) { + if (!d->defaultTransition || !isSoleEntry(d->defaultTransition->targetStates(), state)) { if (!d->defaultTransition || !qobject_cast(d->defaultTransition)) { d->defaultTransition = new DefaultStateTransition(this, state); emit defaultTransitionChanged(QHistoryState::QPrivateSignal()); diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 62a4c03d26..d5b01f3c8a 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -692,7 +692,7 @@ void QStateMachinePrivate::microstep(QEvent *event, const QList