return output;
}
-#if QT_VERSION >= 0x040400
+#if QT_VERSION < 0x040400
+
+#else
static const ConnectionList &qConnectionList(const QObject *ob, int signalNumber)
{
static const ConnectionList emptyList;
d.endItem();
d.putItem("type", "");
if (conn.receiver)
- d.putItem("value", conn.receiver->metaObject()->method(conn.method).signature());
+ d.putItem("value", conn.receiver->metaObject()
+ ->method(conn.method_()).signature());
else
d.putItem("value", "<invalid receiver>");
d.putItem("numchild", "0");
for (SenderList senderList = p->senders; senderList != 0;
senderList = senderList->next, ++s) {
const QObject *sender = senderList->sender;
- int signal = senderList->method; // FIXME: 'method' is wrong.
+ int signal = senderList->method_(); // FIXME: 'method' is wrong.
#else
for (int s = 0; s != p->senders.size(); ++s) {
const QObject *sender = senderAt(p->senders, s);
const ConnectionList &connList = qConnectionList(sender, signal);
for (int i = 0; i != connList.size(); ++i) {
const Connection &conn = connectionAt(connList, i);
- if (conn.receiver == ob && conn.method == slotNumber) {
+ if (conn.receiver == ob && conn.method_() == slotNumber) {
++numchild;
const QMetaMethod &method = sender->metaObject()->method(signal);
qDumpQObjectConnectionPart(d, ob, sender, s, " sender");
d.endItem();
d.putItem("type", "");
d.beginItem("value");
- d.put("<").put(qConnectionType(conn.method));
+ d.put("<").put(qConnectionType(conn.method_()));
d.put(" connection>");
d.endItem();
d.putItem("numchild", "0");
for (SenderList senderList = p->senders; senderList != 0;
senderList = senderList->next, ++s) {
const QObject *sender = senderList->sender;
- int signal = senderList->method; // FIXME: 'method' is wrong.
+ int signal = senderList->method_(); // FIXME: 'method' is wrong.
#else
for (int s = 0; s != p->senders.size(); ++s) {
const QObject *sender = senderAt(p->senders, s);
const ConnectionList &connList = qConnectionList(sender, signal);
for (int c = 0; c != connList.size(); ++c) {
const Connection &conn = connectionAt(connList, c);
- if (conn.receiver == ob && conn.method == k)
+ if (conn.receiver == ob && conn.method_() == k)
++numchild;
}
}
#include <QtCore/QObject>
#include <QtCore/QPointer>
+#include <QtCore/QSharedPointer>
#ifndef QT_BOOTSTRAPPED
struct Sender { QObject *sender; int signal; int ref; };
#if QT_VERSION < 0x040600
-struct Connection
-{
- QObject *receiver;
- int method;
- uint connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking
- QBasicAtomicPointer<int> argumentTypes;
-};
+ struct Connection
+ {
+ QObject *receiver;
+ int method;
+ uint connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking
+ QBasicAtomicPointer<int> argumentTypes;
+ int method_() const { return method; }
+ };
+#elif QT_VERSION < 0x040800
+ struct Connection
+ {
+ QObject *sender;
+ QObject *receiver;
+ int method;
+ uint connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking
+ QBasicAtomicPointer<int> argumentTypes;
+ Connection *nextConnectionList;
+ //senders linked list
+ Connection *next;
+ Connection **prev;
+ int method_() const { return method; }
+ };
+#else
+ typedef void (*StaticMetaCallFunction)(QObject *, QMetaObject::Call, int, void **);
+ struct Connection
+ {
+ QObject *sender;
+ QObject *receiver;
+ StaticMetaCallFunction callFunction;
+ // The next pointer for the singly-linked ConnectionList
+ Connection *nextConnectionList;
+ //senders linked list
+ Connection *next;
+ Connection **prev;
+ QBasicAtomicPointer<int> argumentTypes;
+ ushort method_offset;
+ ushort method_relative;
+ ushort connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking
+ ~Connection();
+ int method() const { return method_offset + method_relative; }
+ int method_() const { return method(); }
+ };
+#endif
-typedef QList<Connection> ConnectionList;
-typedef QList<Sender> SenderList;
+#if QT_VERSION < 0x040600
+ typedef QList<Connection> ConnectionList;
+ typedef QList<Sender> SenderList;
-static inline const Connection &connectionAt(const ConnectionList &l, int i) { return l.at(i); }
-static inline const QObject *senderAt(const SenderList &l, int i) { return l.at(i).sender; }
-static inline int signalAt(const SenderList &l, int i) { return l.at(i).signal; }
+ static inline const Connection &connectionAt(const ConnectionList &l, int i)
+ {
+ return l.at(i);
+ }
+ static inline const QObject *senderAt(const SenderList &l, int i)
+ {
+ return l.at(i).sender;
+ }
+ static inline int signalAt(const SenderList &l, int i)
+ {
+ return l.at(i).signal;
+ }
+//#elif QT_VERSION < 0x040800
#else
-struct Connection
-{
- QObject *sender;
- QObject *receiver;
- int method;
- uint connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking
- QBasicAtomicPointer<int> argumentTypes;
- Connection *nextConnectionList;
- //senders linked list
- Connection *next;
- Connection **prev;
-};
-
-struct ConnectionList
-{
- ConnectionList() : first(0), last(0) { }
- int size() const
+ struct ConnectionList
{
- int count = 0;
- for (Connection *c = first; c != 0; c = c->nextConnectionList)
- ++count;
- return count;
+ ConnectionList() : first(0), last(0) { }
+ int size() const
+ {
+ int count = 0;
+ for (Connection *c = first; c != 0; c = c->nextConnectionList)
+ ++count;
+ return count;
+ }
+
+ Connection *first;
+ Connection *last;
+ };
+
+ typedef Connection *SenderList;
+
+ static inline const Connection &connectionAt(const ConnectionList &l, int i)
+ {
+ Connection *conn = l.first;
+ for (int cnt = 0; cnt < i; ++cnt)
+ conn = conn->nextConnectionList;
+ return *conn;
}
-
- Connection *first;
- Connection *last;
-};
-
-typedef Connection *SenderList;
-
-static inline const Connection &connectionAt(const ConnectionList &l, int i)
-{
- Connection *conn = l.first;
- for (int cnt = 0; cnt < i; ++cnt)
- conn = conn->nextConnectionList;
- return *conn;
-}
#endif
class ObjectPrivate : public QObjectData
void *currentSender;
void *currentChildBeingDeleted;
QList<QPointer<QObject> > eventFilters;
-
void *extraData;
mutable quint32 connectedSignals;
QString objectName;
-
void *connectionLists;
SenderList senders;
int *deleteWatch;
-#else
+#elif QT_VERSION < 0x040800
QString objectName;
void *extraData;
void *threadData;
void *currentChildBeingDeleted;
QAtomicPointer<void> sharedRefcount;
int *deleteWatch;
+#else
+ QString objectName;
+ void *extraData;
+ void *threadData;
+ void *connectionLists;
+ Connection *senders;
+ Sender *currentSender;
+ mutable quint32 connectedSignals[2];
+ void *unused;
+ QList<QPointer<QObject> > eventFilters;
+ union {
+ QObject *currentChildBeingDeleted;
+ void *declarativeData;
+ };
+ QAtomicPointer<void> sharedRefcount;
+ #ifdef QT_JAMBI_BUILD
+ int *deleteWatch;
+ #endif
#endif
};