summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-27 15:57:23 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-27 15:58:43 (GMT)
commitf93097671f512f38790ba2d56bd5b1e037810266 (patch)
treea4dd9aa09a8ca658bb9a46da26472ee0c5f317da /src/corelib/kernel
parent19d0a365dd99dc1a108e58949f7d0f49bac72623 (diff)
parent583b1529894aca5e9ffa353f0547dfb4b8b0ab21 (diff)
downloadQt-f93097671f512f38790ba2d56bd5b1e037810266.zip
Qt-f93097671f512f38790ba2d56bd5b1e037810266.tar.gz
Qt-f93097671f512f38790ba2d56bd5b1e037810266.tar.bz2
Merge commit oslo-staging-2/4.6 into upstream/4.6
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp2
-rw-r--r--src/corelib/kernel/qobject.cpp47
-rw-r--r--src/corelib/kernel/qobject_p.h21
3 files changed, 27 insertions, 43 deletions
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 10a61ca..9335085 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -2546,9 +2546,9 @@ bool QAbstractItemModel::beginMoveRows(const QModelIndex &sourceParent, int sour
int destinationLast = destinationChild + (sourceLast - sourceFirst);
d->changes.push(QAbstractItemModelPrivate::Change(destinationParent, destinationChild, destinationLast));
- d->itemsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Vertical);
emit rowsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild);
emit layoutAboutToBeChanged();
+ d->itemsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Vertical);
return true;
}
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 95602d9..4321c59 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -145,8 +145,7 @@ QObjectPrivate::QObjectPrivate(int version)
receiveChildEvents = true;
postedEvents = 0;
extraData = 0;
- for (uint i = 0; i < (sizeof connectedSignals / sizeof connectedSignals[0]); ++i)
- connectedSignals[i] = 0;
+ connectedSignals = 0;
inEventHandler = false;
inThreadChangeEvent = false;
deleteWatch = 0;
@@ -2937,13 +2936,9 @@ bool QMetaObjectPrivate::connect(const QObject *sender, int signal_index,
QObjectPrivate *const sender_d = QObjectPrivate::get(s);
if (signal_index < 0) {
- for (uint i = 0; i < (sizeof sender_d->connectedSignals
- / sizeof sender_d->connectedSignals[0] ); ++i)
- sender_d->connectedSignals[i] = ~0u;
- } else if (signal_index < (int)sizeof sender_d->connectedSignals * 8) {
- uint n = (signal_index / (8 * sizeof sender_d->connectedSignals[0]));
- sender_d->connectedSignals[n] |= (1 << (signal_index - n * 8
- * sizeof sender_d->connectedSignals[0]));
+ sender_d->connectedSignals = ~ulong(0);
+ } else if (signal_index < (int)sizeof(sender_d->connectedSignals) * 8) {
+ sender_d->connectedSignals |= ulong(1) << signal_index;
}
return true;
@@ -3201,15 +3196,9 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign
computeOffsets(m, &signalOffset, &methodOffset);
int signal_index = signalOffset + local_signal_index;
- if (signal_index < (int)sizeof(sender->d_func()->connectedSignals) * 8
- && !qt_signal_spy_callback_set.signal_begin_callback
- && !qt_signal_spy_callback_set.signal_end_callback) {
- uint n = (signal_index / (8 * sizeof sender->d_func()->connectedSignals[0]));
- uint m = 1 << (signal_index - n * 8 * sizeof sender->d_func()->connectedSignals[0]);
- if ((sender->d_func()->connectedSignals[n] & m) == 0)
- // nothing connected to these signals, and no spy
- return;
- }
+
+ if (!sender->d_func()->isSignalConnected(signal_index))
+ return; // nothing connected to these signals, and no spy
if (sender->d_func()->blockSig)
return;
@@ -3370,28 +3359,6 @@ int QObjectPrivate::signalIndex(const char *signalName) const
return relative_index + signalOffset;
}
-/*! \internal
-
- Returns true if the signal with index \a signal_index from object \a sender is connected.
- Signals with indices above a certain range are always considered connected (see connectedSignals
- in QObjectPrivate). If a signal spy is installed, all signals are considered connected.
-
- \a signal_index must be the index returned by QObjectPrivate::signalIndex;
-*/
-bool QObjectPrivate::isSignalConnected(int signal_index) const
-{
- if (signal_index < (int)sizeof(connectedSignals) * 8
- && !qt_signal_spy_callback_set.signal_begin_callback
- && !qt_signal_spy_callback_set.signal_end_callback) {
- uint n = (signal_index / (8 * sizeof connectedSignals[0]));
- uint m = 1 << (signal_index - n * 8 * sizeof connectedSignals[0]);
- if ((connectedSignals[n] & m) == 0)
- // nothing connected to these signals, and no spy
- return false;
- }
- return true;
-}
-
/*****************************************************************************
Properties
*****************************************************************************/
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index f087407..f899c78 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -172,7 +172,7 @@ public:
}
int signalIndex(const char *signalName) const;
- bool isSignalConnected(int signalIdx) const;
+ inline bool isSignalConnected(int signalIdx) const;
public:
QString objectName;
@@ -183,7 +183,7 @@ public:
Connection *senders; // linked list of connections connected to this object
Sender *currentSender; // object currently activating the object
- mutable quint32 connectedSignals[2]; // 64-bit, so doesn't cause padding on 64-bit platforms
+ mutable ulong connectedSignals;
#ifdef QT3_SUPPORT
QList<QObject *> pendingChildInsertedEvents;
@@ -205,6 +205,23 @@ public:
int *deleteWatch;
};
+/*! \internal
+
+ Returns true if the signal with index \a signal_index from object \a sender is connected.
+ Signals with indices above a certain range are always considered connected (see connectedSignals
+ in QObjectPrivate). If a signal spy is installed, all signals are considered connected.
+
+ \a signal_index must be the index returned by QObjectPrivate::signalIndex;
+*/
+inline bool QObjectPrivate::isSignalConnected(int signal_index) const
+{
+ return signal_index >= (int)sizeof(connectedSignals) * 8
+ || qt_signal_spy_callback_set.signal_begin_callback
+ || qt_signal_spy_callback_set.signal_end_callback
+ || (connectedSignals & (ulong(1) << signal_index));
+}
+
+
inline void q_guard_addGuard(QGuard<QObject> *g)
{
QObjectPrivate *p = QObjectPrivate::get(g->o);