Split up in qt.core.
Annotate for file src/lib/qt_smoke.cpp
2010-01-10 tobias 1 #include "cl_smoke_qt.h"
08:52:09 ' 2
2009-04-05 tobias 3 #include <qnamespace.h>
17:56:16 ' 4 #include <QEvent>
' 5 #include <QtDebug>
' 6
' 7 /** @file
' 8 * @brief Qt support functions */
' 9
2009-12-13 tobias 10 #include <exception>
10:49:35 ' 11
' 12 static void
' 13 terminate()
' 14 {
' 15 qFatal("caught an exception.");
' 16 }
' 17
2009-04-05 tobias 18 extern "C" {
17:56:16 ' 19
' 20 /** Registers a callback to be invoked for every QEvent.
' 21 * @see QCoreApplication::notifyInternal
' 22 *
' 23 * @param callback the callback
' 24 *
2009-08-02 tobias 25 * @return @c true on success and @c false otherwise
2009-04-05 tobias 26 */
2009-05-11 tobias 27 CL_SMOKE_QT_EXPORT int
2010-01-10 tobias 28 cl_smoke_register_event_notify(void* callback)
2009-04-05 tobias 29 {
17:56:16 ' 30 Q_ASSERT(callback);
2009-12-13 tobias 31 std::set_terminate(terminate);
2009-04-05 tobias 32
17:56:16 ' 33 return QInternal::registerCallback(QInternal::EventNotifyCallback,
' 34 reinterpret_cast<qInternalCallback>(callback));
' 35 }
' 36
2009-08-02 tobias 37 /** Returns the most specific QMetaObject of the QObject instance @a object.
11:15:21 ' 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.
' 40 *
' 41 * @param object A QObject
' 42 *
' 43 * @return QMetaObject
' 44 */
' 45 CL_SMOKE_QT_EXPORT void*
2010-01-10 tobias 46 cl_smoke_meta_object(void* object)
2009-08-02 tobias 47 {
11:15:21 ' 48 Q_ASSERT(object);
' 49 static_cast<QObject*>(object)->metaObject();
' 50 }
' 51
' 52
2009-04-05 tobias 53 } // extern "C"