Mercurial > projects > qtd
diff cpp/qt_qtd/qtd_core.cpp @ 372:a032df77b6ab
Simple debug helper. Unittests. Meta-object for polymorphic non-QObjects
author | Max Samukha <maxter@spambox.com> |
---|---|
date | Thu, 08 Jul 2010 17:19:05 +0300 |
parents | 9784459f0750 |
children | 1f189d0ceab4 |
line wrap: on
line diff
--- a/cpp/qt_qtd/qtd_core.cpp Sun Jul 04 14:17:49 2010 +0100 +++ b/cpp/qt_qtd/qtd_core.cpp Thu Jul 08 17:19:05 2010 +0300 @@ -4,16 +4,24 @@ */ #include "qtd_core.h" -#include <iostream> +#include <typeinfo> QTD_EXPORT(CORE, toUtf8); QTD_EXPORT(CORE, QtdObject_delete); -QTD_EXTERN QTD_DLL_EXPORT void qtd_initCore() +QTD_EXTERN QTD_DLL_PUBLIC void qtdInitCore() { QObjectLink::userDataId = QObject::registerUserData(); } +QTD_EXTERN QTD_DLL_PUBLIC bool qtdTypeInfosEqual(void* info1, void* info2) +{ + std::type_info* i1 = (std::type_info*)info1; + std::type_info* i2 = (std::type_info*)info2; + + return i1 == i2 || strcmp(i1->name(), i2->name()) == 0; +} + QTD_EXTERN QTD_DLL_PUBLIC QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia) { return * (QModelIndex *) (&mia) ; @@ -47,13 +55,13 @@ extern bool qUnregisterResourceData (int, const unsigned char *, const unsigned char *, const unsigned char *); -QTD_EXTERN QTD_DLL_PUBLIC bool qtd_register_resource_data(int version, const unsigned char *tree, +QTD_EXTERN QTD_DLL_PUBLIC bool qtd_qRegisterResourceData(int version, const unsigned char *tree, const unsigned char *name, const unsigned char *data) { return qRegisterResourceData(version, tree, name, data); } -QTD_EXTERN QTD_DLL_PUBLIC bool qtd_unregister_resource_data(int version, const unsigned char *tree, +QTD_EXTERN QTD_DLL_PUBLIC bool qtd_qUnregisterResourceData(int version, const unsigned char *tree, const unsigned char *name, const unsigned char *data) { return qUnregisterResourceData(version, tree, name, data);