1 #include "cl_smoke_qt.h"
3 #include <qnamespace.h>
8 * @brief Qt support functions */
15 qFatal("caught an exception.");
20 /** Registers a callback to be invoked for every QEvent.
21 * @see QCoreApplication::notifyInternal
23 * @param callback the callback
25 * @return @c true on success and @c false otherwise
27 CL_SMOKE_QT_EXPORT int
28 cl_smoke_register_event_notify(void* callback)
31 std::set_terminate(terminate);
33 return QInternal::registerCallback(QInternal::EventNotifyCallback,
34 reinterpret_cast<qInternalCallback>(callback));
37 /** Returns the most specific QMetaObject of the QObject instance @a object.
38 * Used to determine the actual class of an object. Smoke can not be used since it calls the
39 * metaObject() of the class the method was called for.
41 * @param object A QObject
45 CL_SMOKE_QT_EXPORT void*
46 cl_smoke_meta_object(void* object)
49 static_cast<QObject*>(object)->metaObject();