summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qobject_p.h')
-rw-r--r--src/corelib/kernel/qobject_p.h21
1 files changed, 19 insertions, 2 deletions
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);