#cmakedefine QT_NO_DRAGANDDROP
#cmakedefine QT_NO_DYNAMIC_CAST
#cmakedefine QT_NO_EFFECTS
-#cmakedefine QT_NO_EMIT
#cmakedefine QT_NO_ERRORMESSAGE
#cmakedefine QT_NO_FILEDIALOG
#cmakedefine QT_NO_FILEICONPROVIDER
Signals and slots
*****************************************************************************/
-
-const char *qFlagLocation(const char *method)
-{
- QThreadData::current()->flaggedSignatures.store(method);
- return method;
-}
-
static inline int extract_code(const char *member)
{
// extract code, ensure QMETHOD_CODE <= code <= QSIGNAL_CODE
return (((int)(*member) - '0') & 0x3);
}
-static const char * extract_location(const char *member)
-{
- if (QThreadData::current()->flaggedSignatures.contains(member)) {
- // signature includes location information after the first null-terminator
- const char *location = member + qstrlen(member) + 1;
- if (*location != '\0')
- return location;
- }
- return Q_NULLPTR;
-}
-
static bool check_signal_macro(const QObject *sender, const char *signal,
const char *func, const char *op)
{
case QSLOT_CODE: type = "slot"; break;
case QSIGNAL_CODE: type = "signal"; break;
}
- const char *loc = extract_location(method);
- if (strchr(method,')') == 0) { // common typing mistake
- qWarning("Object::%s: Parentheses expected, %s %s::%s%s%s",
- func, type, object->metaObject()->className(), method+1,
- loc ? " in ": "", loc ? loc : "");
- } else {
- qWarning("Object::%s: No such %s %s::%s%s%s",
- func, type, object->metaObject()->className(), method+1,
- loc ? " in ": "", loc ? loc : "");
- }
+ qWarning("Object::%s: No such %s %s::%s",
+ func, type, object->metaObject()->className(), method+1);
}
QByteArray method_name;
const char *method_arg = method;
- int membcode = -1;
bool method_found = false;
if (method) {
method_name = QMetaObject::normalizedSignature(method);
method = method_name.constData();
- membcode = extract_code(method);
+ int membcode = extract_code(method);
if (!check_method_code(membcode, receiver, method, "disconnect"))
return false;
method++; // skip code
// They are used, strictly speaking, only by the moc.
#ifndef Q_MOC_RUN
-# if defined(QT_NO_KEYWORDS)
-# define QT_NO_EMIT
-# else
+# ifndef QT_NO_KEYWORDS
# define slots
# define signals protected
+# define emit
# endif
-# define Q_SLOTS
-# define Q_SIGNALS protected
-# define Q_PRIVATE_SLOT(d, signature)
-# define Q_EMIT
-#ifndef QT_NO_EMIT
-# define emit
-#endif
+#define Q_SLOTS
+#define Q_SIGNALS protected
+#define Q_PRIVATE_SLOT(d, signature)
+#define Q_EMIT
#define Q_CLASSINFO(name, value)
#define Q_INTERFACES(x)
#define Q_PROPERTY(text)
#define Q_SLOT Q_SLOT
#endif //Q_MOC_RUN
-// macro for onaming members
-#ifdef METHOD
-#undef METHOD
-#endif
-#ifdef SLOT
-#undef SLOT
-#endif
-#ifdef SIGNAL
-#undef SIGNAL
-#endif
-
-Q_CORE_EXPORT const char *qFlagLocation(const char *method);
-
-#ifndef QT_NO_DEBUG
-# ifndef QT_NO_KEYWORDS
-# define METHOD(a) qFlagLocation("0"#a "\0" Q_FUNC_INFO)
-# endif
-# define SLOT(a) qFlagLocation("1"#a "\0" Q_FUNC_INFO)
-# define SIGNAL(a) qFlagLocation("2"#a "\0" Q_FUNC_INFO)
-#else
-# ifndef QT_NO_KEYWORDS
-# define METHOD(a) "0"#a
-# endif
-# define SLOT(a) "1"#a
-# define SIGNAL(a) "2"#a
-#endif
-
-
-#define QMETHOD_CODE 0 // member type codes
+// definitions and macros for identifying connection types
+#define QMETHOD_CODE 0
#define QSLOT_CODE 1
#define QSIGNAL_CODE 2
+#ifndef QT_NO_KEYWORDS
+# define METHOD(a) "0"#a
+#endif
+#define SLOT(a) "1"#a
+#define SIGNAL(a) "2"#a
+
#define Q_ARG(type, data) QArgument<type >(#type, data)
#define Q_RETURN_ARG(type, data) QReturnArgument<type >(#type, data)
return canWait;
}
- // This class provides per-thread (by way of being a QThreadData
- // member) storage for qFlagLocation()
- class FlaggedDebugSignatures
- {
- static const uint Count = 2;
-
- uint idx;
- const char* locations[Count];
-
- public:
- FlaggedDebugSignatures() : idx(0)
- {
- for (uint i = 0; i < Count; ++i)
- locations[i] = Q_NULLPTR;
- }
-
- void store(const char* method)
- { locations[idx++ % Count] = method; }
-
- bool contains(const char *method) const
- {
- for (uint i = 0; i < Count; ++i)
- if (locations[i] == method)
- return true;
- return false;
- }
- };
-
bool quitNow;
bool canWait;
bool isAdopted;
QThread *thread;
QAbstractEventDispatcher *eventDispatcher;
QPostEventList postEventList;
- FlaggedDebugSignatures flaggedSignatures;
private:
QAtomicInt _ref;