Mercurial > projects > qtd
comparison 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 |
comparison
equal
deleted
inserted
replaced
370:7fd4b69378bf | 372:a032df77b6ab |
---|---|
2 Copyright: Copyright QtD Team, 2008-2010 | 2 Copyright: Copyright QtD Team, 2008-2010 |
3 License: Boost License 1.0 | 3 License: Boost License 1.0 |
4 */ | 4 */ |
5 | 5 |
6 #include "qtd_core.h" | 6 #include "qtd_core.h" |
7 #include <iostream> | 7 #include <typeinfo> |
8 | 8 |
9 QTD_EXPORT(CORE, toUtf8); | 9 QTD_EXPORT(CORE, toUtf8); |
10 QTD_EXPORT(CORE, QtdObject_delete); | 10 QTD_EXPORT(CORE, QtdObject_delete); |
11 | 11 |
12 QTD_EXTERN QTD_DLL_EXPORT void qtd_initCore() | 12 QTD_EXTERN QTD_DLL_PUBLIC void qtdInitCore() |
13 { | 13 { |
14 QObjectLink::userDataId = QObject::registerUserData(); | 14 QObjectLink::userDataId = QObject::registerUserData(); |
15 } | |
16 | |
17 QTD_EXTERN QTD_DLL_PUBLIC bool qtdTypeInfosEqual(void* info1, void* info2) | |
18 { | |
19 std::type_info* i1 = (std::type_info*)info1; | |
20 std::type_info* i2 = (std::type_info*)info2; | |
21 | |
22 return i1 == i2 || strcmp(i1->name(), i2->name()) == 0; | |
15 } | 23 } |
16 | 24 |
17 QTD_EXTERN QTD_DLL_PUBLIC QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia) | 25 QTD_EXTERN QTD_DLL_PUBLIC QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia) |
18 { | 26 { |
19 return * (QModelIndex *) (&mia) ; | 27 return * (QModelIndex *) (&mia) ; |
45 (int, const unsigned char *, const unsigned char *, const unsigned char *); | 53 (int, const unsigned char *, const unsigned char *, const unsigned char *); |
46 | 54 |
47 extern bool qUnregisterResourceData | 55 extern bool qUnregisterResourceData |
48 (int, const unsigned char *, const unsigned char *, const unsigned char *); | 56 (int, const unsigned char *, const unsigned char *, const unsigned char *); |
49 | 57 |
50 QTD_EXTERN QTD_DLL_PUBLIC bool qtd_register_resource_data(int version, const unsigned char *tree, | 58 QTD_EXTERN QTD_DLL_PUBLIC bool qtd_qRegisterResourceData(int version, const unsigned char *tree, |
51 const unsigned char *name, const unsigned char *data) | 59 const unsigned char *name, const unsigned char *data) |
52 { | 60 { |
53 return qRegisterResourceData(version, tree, name, data); | 61 return qRegisterResourceData(version, tree, name, data); |
54 } | 62 } |
55 | 63 |
56 QTD_EXTERN QTD_DLL_PUBLIC bool qtd_unregister_resource_data(int version, const unsigned char *tree, | 64 QTD_EXTERN QTD_DLL_PUBLIC bool qtd_qUnregisterResourceData(int version, const unsigned char *tree, |
57 const unsigned char *name, const unsigned char *data) | 65 const unsigned char *name, const unsigned char *data) |
58 { | 66 { |
59 return qUnregisterResourceData(version, tree, name, data); | 67 return qUnregisterResourceData(version, tree, name, data); |
60 } | 68 } |
61 | 69 |