summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp31
-rw-r--r--src/corelib/global/qglobal.cpp6
-rw-r--r--src/corelib/global/qnamespace.qdoc5
-rw-r--r--src/corelib/io/qsettings.cpp16
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp48
-rw-r--r--src/corelib/kernel/qabstractitemmodel.h3
-rw-r--r--src/corelib/kernel/qcore_symbian_p.cpp4
-rw-r--r--src/corelib/kernel/qobject.cpp14
-rw-r--r--src/corelib/statemachine/qabstracttransition_p.h2
-rw-r--r--src/corelib/statemachine/qsignalevent.h2
-rw-r--r--src/corelib/statemachine/qsignaltransition.cpp17
-rw-r--r--src/corelib/statemachine/qsignaltransition_p.h3
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp7
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp8
14 files changed, 120 insertions, 46 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index dfd6779..49bd8e9 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -259,28 +259,33 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
}
state = newState;
- QPointer<QAbstractAnimation> guard(q);
+ QWeakPointer<QAbstractAnimation> guard(q);
- guard->updateState(oldState, newState);
+ q->updateState(oldState, newState);
+ if (!guard)
+ return;
//this is to be safe if updateState changes the state
if (state == oldState)
return;
// Notify state change
- if (guard)
- emit guard->stateChanged(oldState, newState);
+ emit q->stateChanged(oldState, newState);
+ if (!guard)
+ return;
- switch (state)
- {
+ switch (state) {
case QAbstractAnimation::Paused:
case QAbstractAnimation::Running:
//this ensures that the value is updated now that the animation is running
- if(oldState == QAbstractAnimation::Stopped && guard)
- guard->setCurrentTime(currentTime);
+ if(oldState == QAbstractAnimation::Stopped) {
+ q->setCurrentTime(currentTime);
+ if (!guard)
+ return;
+ }
// Register timer if our parent is not running.
- if (state == QAbstractAnimation::Running && guard) {
+ if (state == QAbstractAnimation::Running) {
if (!group || group->state() == QAbstractAnimation::Stopped) {
QUnifiedTimer::instance()->registerAnimation(q);
}
@@ -292,7 +297,10 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
case QAbstractAnimation::Stopped:
// Leave running state.
int dura = q->duration();
- if (deleteWhenStopped && guard)
+ if (!guard)
+ return;
+
+ if (deleteWhenStopped)
q->deleteLater();
QUnifiedTimer::instance()->unregisterAnimation(q);
@@ -300,8 +308,7 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
if (dura == -1 || loopCount < 0
|| (oldDirection == QAbstractAnimation::Forward && (oldCurrentTime * (oldCurrentLoop + 1)) == (dura * loopCount))
|| (oldDirection == QAbstractAnimation::Backward && oldCurrentTime == 0)) {
- if (guard)
- emit q->finished();
+ emit q->finished();
}
break;
}
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index d7ae78f..7a24ecc 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1903,12 +1903,12 @@ QSysInfo::SymbianVersion QSysInfo::symbianVersion()
*/
/*!
- T *q_check_ptr(T *pointer)
+ \fn T *q_check_ptr(T *pointer)
\relates <QtGlobal>
- Users Q_CHECK_PTR on \a pointer, then returns \a pointer.
+ Users Q_CHECK_PTR on \a pointer, then returns \a pointer.
- This can be used as an inline version of Q_CHECK_PTR.
+ This can be used as an inline version of Q_CHECK_PTR.
*/
/*!
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 657e367..134cbcc 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2445,7 +2445,7 @@
\value ImhNone No hints.
\value ImhHiddenText Characters should be hidden, as is typically used when entering passwords.
This is automatically set when setting QLineEdit::echoMode to \c Password.
- \value ImhNumbersOnly Only number input is allowed.
+ \value ImhDigitsOnly Only number input is allowed.
\value ImhUppercaseOnly Only upper case letter input is allowed.
\value ImhLowercaseOnly Only lower case letter input is allowed.
\value ImhNoAutoUppercase The input method should not try to automatically switch to upper case
@@ -2456,6 +2456,9 @@
\value ImhNoPredictiveText Do not use predictive text (i.e. dictionary lookup) while typing.
\value ImhDialableCharactersOnly Only characters suitable for phone dialling are allowed.
+ \omitvalue ImhFormattedNumbersOnly
+ \omitvalue ImhExclusiveInputMask
+
\note If several flags ending with \c Only are ORed together, the resulting character set will
consist of the union of the specified sets. For instance specifying \c ImhNumbersOnly and
\c ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters.
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index db0c696..de483ed 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -3199,8 +3199,8 @@ bool QSettings::isWritable() const
Note that the Windows registry and INI files use case-insensitive
keys, whereas the Carbon Preferences API on Mac OS X uses
- case-sensitive keys. To avoid portability problems, see the \l{Key
- Syntax} rules.
+ case-sensitive keys. To avoid portability problems, see the
+ \l{Section and Key Syntax} rules.
Example:
@@ -3234,8 +3234,8 @@ void QSettings::setValue(const QString &key, const QVariant &value)
Note that the Windows registry and INI files use case-insensitive
keys, whereas the Carbon Preferences API on Mac OS X uses
- case-sensitive keys. To avoid portability problems, see the \l{Key
- Syntax} rules.
+ case-sensitive keys. To avoid portability problems, see the
+ \l{Section and Key Syntax} rules.
\sa setValue(), value(), contains()
*/
@@ -3269,8 +3269,8 @@ void QSettings::remove(const QString &key)
Note that the Windows registry and INI files use case-insensitive
keys, whereas the Carbon Preferences API on Mac OS X uses
- case-sensitive keys. To avoid portability problems, see the \l{Key
- Syntax} rules.
+ case-sensitive keys. To avoid portability problems, see the
+ \l{Section and Key Syntax} rules.
\sa value(), setValue()
*/
@@ -3331,8 +3331,8 @@ bool QSettings::event(QEvent *event)
Note that the Windows registry and INI files use case-insensitive
keys, whereas the Carbon Preferences API on Mac OS X uses
- case-sensitive keys. To avoid portability problems, see the \l{Key
- Syntax} rules.
+ case-sensitive keys. To avoid portability problems, see the
+ \l{Section and Key Syntax} rules.
Example:
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 1c9104a..5e8848b 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -1339,7 +1339,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
\endlist
- \sa layoutAboutToBeChanged(), dataChanged(), headerDataChanged(), reset(),
+ \sa layoutAboutToBeChanged(), dataChanged(), headerDataChanged(), modelReset(),
changePersistentIndex()
*/
@@ -2769,7 +2769,24 @@ void QAbstractItemModel::endMoveColumns()
/*!
Resets the model to its original state in any attached views.
- The view to which the model is attached to will be reset as well.
+ \note Use beginResetModel() and endResetModel() instead whenever possible.
+ Use this method only if there is no way to call beginResetModel() before invalidating the model.
+ Otherwise it could lead to unexcpected behaviour, especially when used with proxy models.
+*/
+void QAbstractItemModel::reset()
+{
+ Q_D(QAbstractItemModel);
+ emit modelAboutToBeReset();
+ d->invalidatePersistentIndexes();
+ emit modelReset();
+}
+
+/*!
+ Begins a model reset operation.
+
+ A reset operation resets the model to its current state in any attached views.
+
+ \note Any views attached to this model will be reset as well.
When a model is reset it means that any previous data reported from the
model is now invalid and has to be queried for again. This also means that
@@ -2779,12 +2796,29 @@ void QAbstractItemModel::endMoveColumns()
call this function rather than emit dataChanged() to inform other
components when the underlying data source, or its structure, has changed.
- \sa modelAboutToBeReset(), modelReset()
+ You must call this function before resetting any internal data structures in your model
+ or proxy model.
+
+ \sa modelAboutToBeReset(), modelReset(), endResetModel()
+ \since 4.6
*/
-void QAbstractItemModel::reset()
+void QAbstractItemModel::beginResetModel()
{
- Q_D(QAbstractItemModel);
emit modelAboutToBeReset();
+}
+
+/*!
+ Completes a model reset operation.
+
+ You must call this function after resetting any internal data structure in your model
+ or proxy model.
+
+ \sa beginResetModel()
+ \since 4.6
+*/
+void QAbstractItemModel::endResetModel()
+{
+ Q_D(QAbstractItemModel);
d->invalidatePersistentIndexes();
emit modelReset();
}
@@ -3256,7 +3290,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
This signal is emitted when reset() is called, before the model's internal
state (e.g. persistent model indexes) has been invalidated.
- \sa reset(), modelReset()
+ \sa beginResetModel(), modelReset()
*/
/*!
@@ -3266,7 +3300,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
This signal is emitted when reset() is called, after the model's internal
state (e.g. persistent model indexes) has been invalidated.
- \sa reset(), modelAboutToBeReset()
+ \sa endResetModel(), modelAboutToBeReset()
*/
/*!
diff --git a/src/corelib/kernel/qabstractitemmodel.h b/src/corelib/kernel/qabstractitemmodel.h
index b47e4cb..1ca6cbe 100644
--- a/src/corelib/kernel/qabstractitemmodel.h
+++ b/src/corelib/kernel/qabstractitemmodel.h
@@ -293,6 +293,9 @@ protected:
void reset();
+ void beginResetModel();
+ void endResetModel();
+
void changePersistentIndex(const QModelIndex &from, const QModelIndex &to);
void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to);
QModelIndexList persistentIndexList() const;
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp
index 957b92c..a263cc4 100644
--- a/src/corelib/kernel/qcore_symbian_p.cpp
+++ b/src/corelib/kernel/qcore_symbian_p.cpp
@@ -175,10 +175,6 @@ Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal)
return qt_s60_plugin_resolver()->resolve(ordinal);
}
-/*!
-\internal
-Provides global access to a shared RFs.
-*/
class QS60RFsSession
{
public:
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 1f35c73..8abe28e 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -240,18 +240,20 @@ static void computeOffsets(const QMetaObject *metaobject, int *signalOffset, int
}
}
-/*! \internal
+/*
This vector contains the all connections from an object.
- Each object may have one vector containing the lists of connections for a given signal.
- The index in the vector correspond to the signal index.
- The signal index is the one returned by QObjectPrivate::signalIndex (not QMetaObject::indexOfSignal).
+ Each object may have one vector containing the lists of
+ connections for a given signal. The index in the vector correspond
+ to the signal index. The signal index is the one returned by
+ QObjectPrivate::signalIndex (not QMetaObject::indexOfSignal).
Negative index means connections to all signals.
This vector is protected by the object mutex (signalSlotMutexes())
- Each Connection is also part of a 'senders' linked list. The mutex of the receiver must be locked when touching
- the pointers of this linked list.
+ Each Connection is also part of a 'senders' linked list. The mutex
+ of the receiver must be locked when touching the pointers of this
+ linked list.
*/
class QObjectConnectionListVector : public QVector<QObjectPrivate::ConnectionList>
{
diff --git a/src/corelib/statemachine/qabstracttransition_p.h b/src/corelib/statemachine/qabstracttransition_p.h
index 328be16..33e4474 100644
--- a/src/corelib/statemachine/qabstracttransition_p.h
+++ b/src/corelib/statemachine/qabstracttransition_p.h
@@ -75,7 +75,7 @@ public:
static QAbstractTransitionPrivate *get(QAbstractTransition *q);
bool callEventTest(QEvent *e);
- void callOnTransition(QEvent *e);
+ virtual void callOnTransition(QEvent *e);
QState *sourceState() const;
QStateMachine *machine() const;
void emitTriggered();
diff --git a/src/corelib/statemachine/qsignalevent.h b/src/corelib/statemachine/qsignalevent.h
index 7e5d888..de166f4 100644
--- a/src/corelib/statemachine/qsignalevent.h
+++ b/src/corelib/statemachine/qsignalevent.h
@@ -70,6 +70,8 @@ private:
QObject *m_sender;
int m_signalIndex;
QList<QVariant> m_arguments;
+
+ friend class QSignalTransitionPrivate;
};
#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp
index e34448f..fb28c08 100644
--- a/src/corelib/statemachine/qsignaltransition.cpp
+++ b/src/corelib/statemachine/qsignaltransition.cpp
@@ -245,6 +245,23 @@ bool QSignalTransition::event(QEvent *e)
return QAbstractTransition::event(e);
}
+void QSignalTransitionPrivate::callOnTransition(QEvent *e)
+{
+ Q_Q(QSignalTransition);
+
+ QSignalEvent *se = static_cast<QSignalEvent *>(e);
+ int savedSignalIndex;
+ if (e->type() == QEvent::Signal) {
+ savedSignalIndex = se->m_signalIndex;
+ se->m_signalIndex = originalSignalIndex;
+ }
+
+ q->onTransition(e);
+
+ if (e->type() == QEvent::Signal)
+ se->m_signalIndex = savedSignalIndex;
+}
+
QT_END_NAMESPACE
#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qsignaltransition_p.h b/src/corelib/statemachine/qsignaltransition_p.h
index 21082ab..69bbcc9 100644
--- a/src/corelib/statemachine/qsignaltransition_p.h
+++ b/src/corelib/statemachine/qsignaltransition_p.h
@@ -69,9 +69,12 @@ public:
void unregister();
void maybeRegister();
+ virtual void callOnTransition(QEvent *e);
+
QObject *sender;
QByteArray signal;
int signalIndex;
+ int originalSignalIndex;
};
QT_END_NAMESPACE
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index d6946de..e5bca2c 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -1408,6 +1408,7 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
signal.remove(0, 1);
const QMetaObject *meta = sender->metaObject();
int signalIndex = meta->indexOfSignal(signal);
+ int originalSignalIndex = signalIndex;
if (signalIndex == -1) {
signalIndex = meta->indexOfSignal(QMetaObject::normalizedSignature(signal));
if (signalIndex == -1) {
@@ -1416,6 +1417,11 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
return;
}
}
+ // The signal index we actually want to connect to is the one
+ // that is going to be sent, i.e. the non-cloned original index.
+ while (meta->method(signalIndex).attributes() & QMetaMethod::Cloned)
+ --signalIndex;
+
QVector<int> &connectedSignalIndexes = connections[sender];
if (connectedSignalIndexes.size() <= signalIndex)
connectedSignalIndexes.resize(signalIndex+1);
@@ -1435,6 +1441,7 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
}
++connectedSignalIndexes[signalIndex];
QSignalTransitionPrivate::get(transition)->signalIndex = signalIndex;
+ QSignalTransitionPrivate::get(transition)->originalSignalIndex = originalSignalIndex;
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": added signal transition from" << transition->sourceState()
<< ": ( sender =" << sender << ", signal =" << signal
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
index 3103ba1..2da768b 100644
--- a/src/corelib/tools/qlocale_symbian.cpp
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -76,8 +76,8 @@ static TPtrC defaultFormatSpec(TExtendedLocale&)
return TPtrC(KNullDesC);
}
-/*!
- Definition of struct for mapping Symbian to ISO locale
+/*
+ Definition of struct for mapping Symbian to ISO locale
*/
struct symbianToISO {
int symbian_language;
@@ -85,8 +85,8 @@ struct symbianToISO {
};
-/*!
- Mapping from Symbian to ISO locale
+/*
+ Mapping from Symbian to ISO locale
*/
static const symbianToISO symbian_to_iso_list[] = {
{ ELangEnglish, "en_GB" },