53 #include <private/qthread_p.h> 61 #include <private/qorderedmutexlocker_p.h> 62 #include <private/qmutexpool_p.h> 77 for (
int i = 0; i < typeNames.
count(); ++i) {
85 qWarning(
"QObject::connect: Cannot queue arguments of type '%s'\n" 86 "(Make sure '%s' is registered using qRegisterMetaType().)",
92 types[typeNames.
count()] = 0;
105 if (!signalSlotMutexes) {
111 return signalSlotMutexes->
get(o);
121 if(!objectCount.
deref()) {
134 : threadData(0), connectionLists(0), senders(0), currentSender(0), currentChildBeingDeleted(0)
137 qFatal(
"Cannot mix incompatible Qt library (version 0x%x) with this library (version 0x%x)",
153 #ifdef QT_JAMBI_BUILD 176 #ifdef QT_JAMBI_BUILD 180 #ifndef QT_NO_USERDATA 188 #ifdef QT_JAMBI_BUILD 190 int *old = d->deleteWatch;
196 void QObjectPrivate::resetDeleteWatch(
QObjectPrivate *d,
int *oldWatch,
int deleteWatch) {
198 d->deleteWatch = oldWatch;
201 *oldWatch = deleteWatch;
206 void QObjectPrivate::sendPendingChildInsertedEvents()
209 for (
int i = 0; i < pendingChildInsertedEvents.size(); ++i) {
210 QObject *
c = pendingChildInsertedEvents.at(i).data();
211 if (!c || c->
parent() != q)
216 pendingChildInsertedEvents.clear();
227 *signalOffset = *methodOffset = 0;
279 if (signal_index < 0)
283 if (signal_index < connectionLists->count()) {
303 if (signal_index < 0)
307 if (signal_index < connectionLists->count()) {
326 returnValue <<
c->sender;
338 if (connectionList.
last) {
343 connectionList.
last =
c;
354 (*connectionLists)[signal];
378 connectionList.
last = last;
421 for (; it.
key() == *ptr && it !=
end; ++
it) {
423 it = hash->
erase(it);
424 if (!more) more = (it != end && it.
key() == *
ptr);
451 for (; it.
key() == *ptr && it !=
end; ++
it) {
453 it = hash->
erase(it);
454 if (!more) more = (it != end && it.
key() == *
ptr);
473 mutex = guardHashLock();
474 }
QT_CATCH(
const std::bad_alloc &) {
480 if (hash && !hash->
isEmpty()) {
484 while (it.
key() ==
object && it !=
end) {
486 it = hash->
erase(it);
494 const QObject *sender,
int signalId,
496 :
QEvent(MetaCall), sender_(sender), signalId_(signalId),
497 nargs_(nargs), types_(types), args_(args), semaphore_(semaphore),
498 callFunction_(callFunction), method_offset_(method_offset), method_relative_(method_relative)
506 for (
int i = 0; i <
nargs_; ++i) {
703 if (list.
size() == 0)
return 0;
704 for (
int i = 0; i < list.
size(); ++i) {
705 QObject *obj = list.
at(i);
722 if (parent && parentThreadData != currentThreadData) {
725 qWarning(
"QObject: Cannot create children for a parent that is in a different thread.\n" 726 "(Parent is %s(%p), parent's thread is %s(%p), current thread is %s(%p)",
867 qWarning(
"QObject: shared QObject was deleted directly. The program is malformed and may crash.");
884 qWarning(
"Detected an unexpected exception in ~QObject while emitting destroyed().");
905 for (
int signal = -1; signal < connectionListsCount; ++signal) {
911 connectionList.
first =
c->nextConnectionList;
921 if (
c->next)
c->next->prev =
c->prev;
926 connectionList.
first =
c->nextConnectionList;
947 if (!node || node->
sender != sender) {
954 senderLists->
dirty =
true;
970 #ifdef QT_JAMBI_BUILD 972 qWarning(
"QObject: Do not delete object, '%s', during its event handler!",
981 delete []
static_cast<int *
>(argumentTypes);
1119 if (objectNameChanged)
1132 static QObject *qChildHelper(
const char *objName,
const char *inheritsClass,
1138 bool onlyWidgets = (inheritsClass &&
qstrcmp(inheritsClass,
"QWidget") == 0);
1140 for (
int i = 0; i < children.
size(); ++i) {
1141 QObject *obj = children.
at(i);
1145 }
else if ((!inheritsClass || obj->
inherits(inheritsClass))
1148 if (recursiveSearch && (obj = qChildHelper(objName, inheritsClass,
1149 recursiveSearch, obj->
children())))
1168 QObject* QObject::child(
const char *objName,
const char *inheritsClass,
1169 bool recursiveSearch)
const 1172 return qChildHelper(objName, inheritsClass, recursiveSearch, d->
children);
1202 switch (e->
type()) {
1208 case QEvent::ChildInsertedRequest:
1209 d_func()->sendPendingChildInsertedEvents();
1216 case QEvent::ChildInserted:
1228 #ifdef QT_JAMBI_BUILD 1229 d_func()->inEventHandler =
false;
1233 currentSender.
sender =
const_cast<QObject*
>(mce->
sender());
1235 currentSender.
ref = 1;
1238 #if defined(QT_NO_EXCEPTIONS) 1256 if (eventDispatcher) {
1421 return d_func()->threadData->
thread;
1468 qWarning(
"QObject::moveToThread: Cannot move objects with a parent");
1472 qWarning(
"QObject::moveToThread: Widgets cannot be moved to a new thread");
1482 qWarning(
"QObject::moveToThread: Current thread (%p) is not the object's thread (%p).\n" 1483 "Cannot move to target thread (%p)\n",
1487 qWarning(
"On Mac OS X, you might be loading two sets of Qt binaries into the same process. " 1488 "Check that all plugins are compiled against the right Qt binaries. Export " 1489 "DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.");
1505 d_func()->setThreadData_helper(currentData, targetData);
1510 currentData->
deref();
1518 for (
int i = 0; i < children.
size(); ++i) {
1519 QObject *child = children.
at(i);
1520 child->d_func()->moveToThread_helper();
1529 int eventsMoved = 0;
1548 currentSender->ref = 0;
1551 #ifdef QT_JAMBI_BUILD 1553 inEventHandler =
false;
1562 threadData->deref();
1563 threadData = targetData;
1565 for (
int i = 0; i < children.
size(); ++i) {
1566 QObject *child = children.
at(i);
1567 child->d_func()->setThreadData_helper(currentData, targetData);
1576 for (
int i = 0; i < timerList->
size(); ++i) {
1578 eventDispatcher->registerTimer(pair.
first, pair.
second, q);
1628 qWarning(
"QObject::startTimer: QTimer cannot have a negative interval");
1635 qWarning(
"QObject::startTimer: QTimer can only be used with threads started with QThread");
1692 const char *inheritsClass,
1694 const char *objName,
1698 for (
int i = 0; i < list.
size(); ++i) {
1699 QObject *obj = list.
at(i);
1705 else if (inheritsClass && !obj->
inherits(inheritsClass))
1710 #ifndef QT_NO_REGEXP 1720 objSearch(result, clist, inheritsClass,
1721 onlyWidgets, objName, rx, recurse);
1768 QObjectList QObject::queryList(
const char *inheritsClass,
1769 const char *objName,
1771 bool recursiveSearch)
const 1775 bool onlyWidgets = (inheritsClass &&
qstrcmp(inheritsClass,
"QWidget") == 0);
1776 #ifndef QT_NO_REGEXP 1777 if (regexpMatch && objName) {
1779 objSearch(list, d->
children, inheritsClass, onlyWidgets, 0, &rx, recursiveSearch);
1783 objSearch(list, d->
children, inheritsClass, onlyWidgets, objName, 0, recursiveSearch);
1903 if (!parent || !list)
1907 for (
int i = 0; i < children.
size(); ++i) {
1908 obj = children.
at(i);
1931 for (i = 0; i < children.
size(); ++i) {
1932 obj = children.
at(i);
1936 for (i = 0; i < children.
size(); ++i) {
1959 const bool reallyWasDeleted = wasDeleted;
1964 for (
int i = 0; i < children.
count(); ++i) {
1965 currentChildBeingDeleted = children.
at(i);
1967 delete currentChildBeingDeleted;
1970 currentChildBeingDeleted = 0;
1971 wasDeleted = reallyWasDeleted;
2001 if (threadData != parent->d_func()->threadData) {
2002 qWarning(
"QObject::setParent: Cannot set parent, new parent is in a different thread");
2007 if(sendChildEvents && parent->d_func()->receiveChildEvents) {
2012 if (QCoreApplicationPrivate::useQt3Support) {
2013 if (parent->d_func()->pendingChildInsertedEvents.isEmpty()) {
2015 new QEvent(QEvent::ChildInsertedRequest),
2018 parent->d_func()->pendingChildInsertedEvents.append(q);
2024 if (!wasDeleted && declarativeData)
2075 if (d->
threadData != obj->d_func()->threadData) {
2076 qWarning(
"QObject::installEventFilter(): Cannot filter events for objects in a different thread.");
2231 return (((
int)(*member) -
'0') & 0x3);
2239 if (*location !=
'\0')
2246 const char *func,
const char *op)
2251 qWarning(
"Object::%s: Attempt to %s non-signal %s::%s",
2254 qWarning(
"Object::%s: Use the SIGNAL macro to %s %s::%s",
2262 const char *method,
const char *func)
2265 qWarning(
"Object::%s: Use the SLOT or SIGNAL macro to " 2273 const char *method,
const char *func)
2275 const char *
type =
"method";
2281 if (strchr(method,
')') == 0)
2282 qWarning(
"Object::%s: Parentheses expected, %s %s::%s%s%s",
2284 loc ?
" in ":
"", loc ? loc :
"");
2286 qWarning(
"Object::%s: No such %s %s::%s%s%s",
2288 loc ?
" in ":
"", loc ? loc :
"");
2295 const QObject * receiver)
2412 signal = signal_name;
2419 if (signal_index < 0) {
2429 if (signal_index < d->connectionLists->count()) {
2470 int *signalIndex,
int *methodIndex)
2474 if (!obj || !member.
mobj)
2478 while (m != 0 && m != member.
mobj)
2482 *signalIndex = *methodIndex = (member.
handle -
get(member.
mobj)->methodData)/5;
2488 *methodIndex += methodOffset;
2490 *signalIndex = originalClone(m, *signalIndex);
2491 *signalIndex += signalOffset;
2502 qWarning(
"QObject::connect: Connecting from COMPAT signal (%s::%s)",
2506 qWarning(
"QObject::connect: Connecting from %s::%s to COMPAT slot (%s::%s)",
2581 const QObject *receiver,
const char *method,
2585 const void *cbdata[] = {
sender, signal, receiver, method, &type };
2591 bool warnCompat =
true;
2600 if (sender == 0 || receiver == 0 || signal == 0 || method == 0) {
2601 qWarning(
"QObject::connect: Cannot connect %s::%s to %s::%s",
2603 (signal && *signal) ? signal+1 :
"(null)",
2605 (method && *method) ? method+1 :
"(null)");
2613 const char *signal_arg = signal;
2616 if (signal_index < 0) {
2619 signal = tmp_signal_name.
constData() + 1;
2624 if (signal_index < 0) {
2630 if (signal_index < 0) {
2636 int signalOffset, methodOffset;
2638 int signal_absolute_index = signal_index + methodOffset;
2639 signal_index += signalOffset;
2646 const char *method_arg = method;
2650 int method_index_relative = -1;
2660 if (method_index_relative < 0) {
2670 if (method_index_relative < 0)
2675 if (method_index_relative < 0)
2681 if (method_index_relative < 0) {
2688 qWarning(
"QObject::connect: Incompatible sender/receiver arguments" 2689 "\n %s::%s --> %s::%s",
2731 const QObject *receiver,
const QMetaMethod &method,
2735 bool warnCompat =
true;
2748 qWarning(
"QObject::connect: Cannot connect %s::%s to %s::%s",
2781 if (signal_index == -1) {
2782 qWarning(
"QObject::connect: Can't find signal %s on instance of class %s",
2786 if (method_index == -1) {
2787 qWarning(
"QObject::connect: Can't find method %s on instance of class %s",
2793 qWarning(
"QObject::connect: Incompatible sender/receiver arguments" 2794 "\n %s::%s --> %s::%s",
2896 const QObject *receiver,
const char *method)
2898 if (sender == 0 || (receiver == 0 && method != 0)) {
2899 qWarning(
"Object::disconnect: Unexpected null parameter");
2904 const void *cbdata[] = {
sender, signal, receiver, method };
2909 const char *signal_arg = signal;
2911 bool signal_found =
false;
2916 }
QT_CATCH (
const std::bad_alloc &) {
2928 const char *method_arg = method;
2930 bool method_found =
false;
2935 }
QT_CATCH(
const std::bad_alloc &) {
2954 int signal_index = -1;
2957 if (signal_index < 0)
2959 if (signal_index < 0)
2962 int signalOffset, methodOffset;
2964 signal_index += signalOffset;
2965 signal_found =
true;
2974 if (method_index >= 0)
2975 while (method_index < rmeta->methodOffset())
2977 if (method_index < 0)
2980 method_found =
true;
2983 }
while (signal && (smeta = smeta->
superClass()));
2985 if (signal && !signal_found) {
2988 }
else if (method && !method_found) {
3027 const QObject *receiver,
const QMetaMethod &method)
3029 if (sender == 0 || (receiver == 0 && method.
mobj != 0)) {
3030 qWarning(
"Object::disconnect: Unexpected null parameter");
3035 qWarning(
"Object::%s: Attempt to %s non-signal %s::%s",
3036 "disconnect",
"unbind",
3043 qWarning(
"QObject::disconect: cannot use constructor as argument %s::%s",
3076 if (signal.
mobj && signal_index == -1) {
3077 qWarning(
"QObject::disconect: signal %s not found on class %s",
3082 if (receiver && method.
mobj && method_index == -1) {
3083 qWarning(
"QObject::disconect: method %s not found on class %s",
3171 if (signal_index < 0)
3172 return signal_index;
3173 while (metaObject && metaObject->
methodOffset() > signal_index)
3177 int signalOffset, methodOffset;
3179 if (signal_index < metaObject->methodCount())
3182 signal_index = signal_index - methodOffset + signalOffset;
3184 return signal_index;
3195 const QObject *receiver,
int method_index,
int type,
int *
types)
3199 receiver, method_index,
3210 const QObject *receiver,
int method_index,
3213 QObject *s =
const_cast<QObject *
>(
sender);
3214 QObject *r =
const_cast<QObject *
>(receiver);
3219 ? reinterpret_cast<const QMetaObjectExtraData *>(rmeta->
d.
extradata)->static_metacall : 0;
3226 if (connectionLists && connectionLists->
count() > signal_index) {
3228 (*connectionLists)[signal_index].first;
3230 int method_index_absolute = method_index + method_offset;
3233 if (c2->
receiver == receiver && c2->
method() == method_index_absolute)
3238 type &= Qt::UniqueConnection - 1;
3265 if (signal_index < 0) {
3268 sender_d->
connectedSignals[signal_index >> 5] |= (1 << (signal_index & 0x1f));
3277 const QObject *receiver,
int method_index)
3281 receiver, method_index);
3291 const QObject *receiver,
int method_index)
3295 receiver, method_index,
3303 const QObject *receiver,
int method_index,
3306 bool success =
false;
3309 && (receiver == 0 || (c->
receiver == receiver
3310 && (method_index < 0 || c->method() == method_index)))) {
3311 bool needToUnlock =
false;
3312 QMutex *receiverMutex = 0;
3331 if (disconnectType == DisconnectOne)
3343 const QObject *receiver,
int method_index,
3349 QObject *s =
const_cast<QObject *
>(
sender);
3356 if (!connectionLists)
3360 ++connectionLists->
inUse;
3362 bool success =
false;
3363 if (signal_index < 0) {
3365 for (signal_index = -1; signal_index < connectionLists->
count(); ++signal_index) {
3367 (*connectionLists)[signal_index].first;
3368 if (disconnectHelper(c, receiver, method_index, senderMutex, disconnectType)) {
3370 connectionLists->
dirty =
true;
3373 }
else if (signal_index < connectionLists->count()) {
3375 (*connectionLists)[signal_index].first;
3376 if (disconnectHelper(c, receiver, method_index, senderMutex, disconnectType)) {
3378 connectionLists->
dirty =
true;
3382 --connectionLists->
inUse;
3385 delete connectionLists;
3416 if (slot[0] !=
'o' || slot[1] !=
'n' || slot[2] !=
'_')
3418 bool foundIt =
false;
3419 for(
int j = 0; j < list.
count(); ++j) {
3420 const QObject *co = list.
at(j);
3422 int len = objName.
length();
3423 if (!len ||
qstrncmp(slot + 3, objName.
data(), len) || slot[len+3] !=
'_')
3425 int sigIndex = co->d_func()->signalIndex(slot + len + 4);
3428 int slotlen =
qstrlen(slot + len + 4) - 1;
3435 int signalOffset, methodOffset;
3437 sigIndex = k + - methodOffset + signalOffset;
3454 qWarning(
"QMetaObject::connectSlotsByName: No matching signal for %s", slot);
3478 void **args = (
void **)
qMalloc(nargs*
sizeof(
void *));
3482 for (
int n = 1; n < nargs; ++n)
3487 sender, signal, nargs,
3499 activate(sender, from_signal_index, argv);
3511 int signal_index = signalOffset + local_signal_index;
3513 if (!sender->d_func()->isSignalConnected(signal_index))
3516 if (sender->d_func()->blockSig)
3519 int signal_absolute_index = methodOffset + local_signal_index;
3521 void *empty_argv[] = { 0 };
3524 argv ? argv : empty_argv);
3531 if (!connectionLists) {
3537 ++connectionLists->
inUse;
3541 if (signal_index < connectionLists->count())
3542 list = &connectionLists->
at(signal_index);
3557 QObject *
const receiver = c->
receiver;
3558 const bool receiverInSameThread = currentThreadId == receiver->d_func()->threadData->threadId;
3564 queued_activate(sender, signal_absolute_index, c, argv ? argv : empty_argv);
3566 #ifndef QT_NO_THREAD 3569 if (receiverInSameThread) {
3570 qWarning(
"Qt: Dead lock detected while activating a BlockingQueuedConnection: " 3571 "Sender is %s(%p), receiver is %s(%p)",
3578 sender, signal_absolute_index,
3580 argv ? argv : empty_argv,
3582 semaphore.acquire();
3590 if (receiverInSameThread) {
3592 currentSender.
signal = signal_absolute_index;
3593 currentSender.
ref = 1;
3604 #if defined(QT_NO_EXCEPTIONS) 3611 if (receiverInSameThread)
3614 --connectionLists->
inUse;
3617 delete connectionLists;
3631 argv ? argv : empty_argv);
3634 #if defined(QT_NO_EXCEPTIONS) 3641 if (receiverInSameThread)
3644 --connectionLists->
inUse;
3647 delete connectionLists;
3658 if (receiverInSameThread)
3667 }
while (list != &connectionLists->
allsignals &&
3669 ((list = &connectionLists->
allsignals),
true));
3671 --connectionLists->
inUse;
3674 if (!connectionLists->
inUse)
3675 delete connectionLists;
3676 }
else if (connectionLists->
dirty) {
3677 sender->d_func()->cleanConnectionLists();
3695 activate(sender, mo, signal_index - mo->
methodOffset(), argv);
3703 int from_local_signal_index,
int to_local_signal_index,
void **argv)
3707 activate(sender, m, from_local_signal_index, argv);
3724 if (relative_index < 0)
3726 if (relative_index < 0)
3727 return relative_index;
3729 int signalOffset, methodOffset;
3731 return relative_index + signalOffset;
3738 #ifndef QT_NO_PROPERTIES 3791 qWarning(
"%s::setProperty: Property \"%s\" invalid," 3794 return p.
write(
this, value);
3824 qWarning(
"%s::property: Property \"%s\" invalid or does not exist",
3827 return p.
read(
this);
3847 #endif // QT_NO_PROPERTIES 3856 #if defined(QT_DEBUG) 3859 buf.
fill(
' ', level / 2 * 8);
3865 if (
qApp->focusWidget() == object)
3880 if (!children.isEmpty()) {
3881 for (
int i = 0; i < children.size(); ++i)
3919 #if defined(QT_DEBUG) 3931 int offsetToNextMetaObject = 0;
3933 if (signal_index >= offsetToNextMetaObject) {
3935 int signalOffset, methodOffset;
3937 while (signalOffset > signal_index) {
3939 offsetToNextMetaObject = signalOffset;
3942 offset = methodOffset - signalOffset;
3952 qDebug(
" <Disconnected receiver>");
3953 c = c->nextConnectionList;
3956 const QMetaObject *receiverMetaObject = c->receiver->metaObject();
3960 c->receiver->objectName().isEmpty() ?
"unnamed" :
qPrintable(c->receiver->objectName()),
3962 c = c->nextConnectionList;
3976 s->sender->metaObject()->className(),
3977 s->sender->objectName().isEmpty() ?
"unnamed" :
qPrintable(s->sender->objectName()),
3986 #ifndef QT_NO_USERDATA 3991 static int user_data_registration = 0;
3992 return user_data_registration++;
4021 if ((
int)id < d->extraData->userData.size())
4026 #endif // QT_NO_USERDATA 4029 #ifndef QT_NO_DEBUG_STREAM 4031 #ifndef Q_BROKEN_DEBUG_STREAM 4033 return dbg <<
"QObject(0x0) ";
4040 qWarning(
"This compiler doesn't support streaming QObject to QDebug");
4350 #ifdef QT_JAMBI_BUILD 4361 #include "moc_qobject.cpp" The QVariant class acts like a union for the most common Qt data types.
static void clearGuards(QObject *)
int startTimer(int interval)
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer...
The QMultiHash class is a convenience QHash subclass that provides multi-valued hashes.
The QDebug class provides an output stream for debugging information.
static uint hash(const uchar *p, int n)
virtual ~QObject()
Destroys the object, deleting all its child objects.
const T * constData() const
static Sender * setCurrentSender(QObject *receiver, Sender *sender)
bool blockSignals(bool b)
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke...
BeginCallback slot_begin_callback
QByteArray & fill(char c, int size=-1)
Sets every byte in the byte array to character ch.
#define QT_END_NAMESPACE
This macro expands to.
The QSemaphore class provides a general counting semaphore.
The QMutex class provides access serialization between threads.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
EndCallback slot_end_callback
char * data()
Returns a pointer to the data stored in the byte array.
static void signalSignature(const QMetaMethod &signal, QVarLengthArray< char > *result)
void qt_qFindChildren_helper(const QObject *parent, const QString &name, const QRegExp *re, const QMetaObject &mo, QList< void *> *list)
Q_CORE_EXPORT void qt_addObject(QObject *)
The QRegExp class provides pattern matching using regular expressions.
static QBasicAtomicInt objectCount
QObjectPrivate::ConnectionList allsignals
#define it(className, varName)
static const char * extract_location(const char *member)
int count(const T &t) const
Returns the number of occurrences of value in the vector.
QByteArray & append(char c)
Appends the character ch to this byte array.
void moveToThread_helper()
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
void addConnection(int signal, Connection *c)
Q_CORE_EXPORT void qFree(void *ptr)
QString objectName
the name of this object
QMultiHash< QObject *, QObject ** > GuardHash
#define at(className, varName)
The QByteArray class provides an array of bytes.
void setUserData(uint id, QObjectUserData *data)
int senderSignalIndex() const
QObjectUserData * userData(uint id) const
static void computeOffsets(const QMetaObject *metaobject, int *signalOffset, int *methodOffset)
QObjectList senderList() const
void removeEventFilter(QObject *)
Removes an event filter object obj from this object.
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
void cleanConnectionLists()
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
void unlock()
Unlocks this mutex locker.
void * qt_find_obj_child(QObject *parent, const char *type, const QString &name)
Returns a pointer to the object named name that inherits type and with a given parent.
T & operator[](int i)
Returns the item at index position i as a modifiable reference.
The QDynamicPropertyChangeEvent class contains event parameters for dynamic property change events...
void addEvent(const QPostEvent &ev)
#define Q_ARG(type, data)
bool testAndSetOrdered(T *expectedValue, T *newValue)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
FlaggedDebugSignatures flaggedSignatures
void release(int n=1)
Releases n resources guarded by the semaphore.
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
static void dumpRecursive(int level, QObject *object)
virtual bool unregisterTimer(int timerId)=0
Unregisters the timer with the given timerId.
Q_CORE_EXPORT void * qMalloc(size_t size)
T & value() const
Returns a modifiable reference to the current item's value.
QDebug operator<<(QDebug dbg, const QObject *o)
The QString class provides a Unicode character string.
static int DIRECT_CONNECTION_ONLY
The QVector class is a template class that provides a dynamic array.
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
#define Q_BASIC_ATOMIC_INITIALIZER(a)
static bool check_signal_macro(const QObject *sender, const char *signal, const char *func, const char *op)
virtual void connectNotify(const char *signal)
This virtual function is called when something has been connected to signal in this object...
static void(* objectNameChanged)(QAbstractDeclarativeData *, QObject *)
static QObjectPrivate * get(QObject *o)
QHash< Key, T >::iterator find(const Key &key, const T &value)
Returns an iterator pointing to the item with the key and value.
BeginCallback signal_begin_callback
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
void resize(int size)
Sets the size of the vector to size.
void setParent(QObject *)
Makes the object a child of parent.
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
void setObjectName(const QString &name)
static int methodIndexToSignalIndex(const QMetaObject *metaObject, int signal_index)
void relock()
Relocks an unlocked mutex locker.
static void err_info_about_objects(const char *func, const QObject *sender, const QObject *receiver)
QList< QPointer< QObject > > eventFilters
Q_CORE_EXPORT void qDebug(const char *,...)
static void err_method_notfound(const QObject *object, const char *method, const char *func)
virtual QList< TimerInfo > registeredTimers(QObject *object) const =0
Returns a list of registered timers for object.
void setParent_helper(QObject *)
static QThreadData * get2(QThread *thread)
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void destroyed(QObject *=0)
This signal is emitted immediately before the object obj is destroyed, and can not be blocked...
static bool isEmpty(const char *str)
int indexIn(const QString &str, int offset=0, CaretMode caretMode=CaretAtZero) const
Attempts to find a match in str from position offset (0 by default).
QObjectPrivate(int version=QObjectPrivateVersion)
static bool activateCallbacks(Callback, void **)
void(* StaticMetaCallFunction)(QObject *, QMetaObject::Call, int, void **)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
virtual void childEvent(QChildEvent *)
This event handler can be reimplemented in a subclass to receive child events.
static QBasicAtomicPointer< QMutexPool > signalSlotMutexes
static bool check_method_code(int code, const QObject *object, const char *method, const char *func)
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
void prepend(const T &t)
Inserts value at the beginning of the list.
const T & at(int i) const
Returns the item at index position i in the list.
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
Q_CORE_EXPORT void qWarning(const char *,...)
int receivers(const char *signal) const
Returns the number of receivers connected to the signal.
QBasicAtomicPointer< int > argumentTypes
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
QPostEventList postEventList
quint32 connectedSignals[2]
int registerTimer(int interval, QObject *object)
Registers a timer with the specified interval for the given object.
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
void moveToThread(QThread *thread)
Changes the thread affinity for this object and its children.
QMutex * get(const void *address)
Returns a QMutex from the pool.
static void resetCurrentSender(QObject *receiver, Sender *currentSender, Sender *previousSender)
T value(int i) const
Returns the value at index position i in the list.
const T * ptr(const T &t)
virtual ~QObjectPrivate()
virtual void wakeUp()=0
Wakes up the event loop.
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
void clear()
Removes all items from the list.
T * fetchAndStoreAcquire(T *newValue)
const Key & key() const
Returns the current item's key as a const reference.
virtual ~QObjectUserData()
static uint registerUserData()
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
QAbstractDeclarativeData * declarativeData
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
void _q_reregisterTimers(void *pointer)
EndCallback signal_end_callback
virtual void customEvent(QEvent *)
This event handler can be reimplemented in a subclass to receive custom events.
Q_CORE_EXPORT void qt_removeObject(QObject *)
const T & at(int i) const
Returns the item at index position i in the vector.
static QMutex * signalSlotLock(const QObject *o)
virtual bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
QObjectConnectionListVector()
int length() const
Same as size().
The QChildEvent class contains event parameters for child object events.
bool isSender(const QObject *receiver, const char *signal) const
const char * constData() const
Returns a pointer to the data stored in the byte array.
QHash< Key, T >::iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
bool isNull() const
Returns true if this string is null; otherwise returns false.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
Connection * nextConnectionList
uint qstrlen(const char *str)
Q_CORE_EXPORT void qFatal(const char *,...)
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
bool isSignalConnected(uint signalIdx) const
Returns true if the signal with index signal_index from object sender is connected.
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
void store(const char *method)
void qDeleteInEventHandler(QObject *o)
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
The QTimerEvent class contains parameters that describe a timer event.
virtual void disconnectNotify(const char *signal)
This virtual function is called when something has been disconnected from signal in this object...
static void queued_activate(QObject *sender, int signal, QObjectPrivate::Connection *c, void **argv)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
QList< QByteArray > dynamicPropertyNames() const
Returns the names of all properties that were dynamically added to the object using setProperty()...
QObject * parent() const
Returns a pointer to the parent object.
static QTestResult::TestLocation location
static bool check_parent_thread(QObject *parent, QThreadData *parentThreadData, QThreadData *currentThreadData)
static void(* parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *)
void installEventFilter(QObject *)
Installs an event filter filterObj on this object.
The QMutexPool class provides a pool of QMutex objects.
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
int size() const
Returns the number of items in the list.
QByteArray toAscii() const Q_REQUIRED_RESULT
Returns an 8-bit representation of the string as a QByteArray.
int qstrncmp(const char *str1, const char *str2, uint len)
static void(* destroyed)(QAbstractDeclarativeData *, QObject *)
QString objectName() const
QSignalSpyCallbackSet Q_CORE_EXPORT qt_signal_spy_callback_set
void dumpObjectInfo()
Dumps information about signal connections, etc.
static int * queuedConnectionTypes(const QList< QByteArray > &typeNames)
const QObjectList & children() const
Returns a list of child objects.
static QThreadData * current()
QVariant property(const char *name) const
Returns the value of the object's name property.
QScopedPointer< QObjectData > d_ptr
void dumpObjectTree()
Dumps a tree of children to the debug output.
QObjectPrivate::ConnectionList & operator[](int at)
QObject * currentChildBeingDeleted
int qstrcmp(const QByteArray &str1, const char *str2)
removePostedEvents
Removes all events of the given eventType that were posted using postEvent() for receiver.
QThread * thread() const
Returns the thread in which the object lives.
void setThreadData_helper(QThreadData *currentData, QThreadData *targetData)
QObjectList receiverList(const char *signal) const
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
void reserve(int size)
Attempts to allocate memory for at least size bytes.
static const KeyPair *const end
const char * qFlagLocation(const char *method)
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
static int extract_code(const char *member)
The QEvent class is the base class of all event classes.
StaticMetaCallFunction callFunction
#define qPrintable(string)
Type type() const
Returns the event type.
static void check_and_warn_compat(const QMetaObject *sender, const QMetaMethod &signal, const QMetaObject *receiver, const QMetaMethod &method)
The QThread class provides a platform-independent way to manage threads.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
int size() const
Returns the number of items in the vector.
QAbstractEventDispatcher * eventDispatcher
void deleteLater()
Schedules this object for deletion.
QList< T > findChildren(const QString &aName=QString()) const
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
iterator erase(iterator it)
Removes the (key, value) pair associated with the iterator pos from the hash, and returns an iterator...
virtual bool unregisterTimers(QObject *object)=0
Unregisters all the timers associated with the given object.
QObjectConnectionListVector * connectionLists
The QAbstractEventDispatcher class provides an interface to manage Qt's event queue.
QObject * qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo)
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
static bool isNull(const QVariant::Private *d)
bool endsWith(const QByteArray &a) const
Returns true if this byte array ends with byte array ba; otherwise returns false. ...
int signalIndex(const char *signalName) const
Returns the signal index used in the internal connectionLists vector.
void killTimer(int id)
Kills the timer with timer identifier, id.
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
static Qt::HANDLE currentThreadId()
Returns the thread handle of the currently executing thread.
void removeAt(int i)
Removes the item at index position i.