@@ -58,10 +58,8 int main( int argc, char **argv ) | |||
|
58 | 58 | // Alternative 1: make CustomObject known and use decorators for wrapping: |
|
59 | 59 | // ----------------------------------------------------------------- |
|
60 | 60 | |
|
61 | // register the new object as a known classname | |
|
62 | PythonQt::self()->registerCPPClassNames(QStringList() << "CustomObject"); | |
|
63 | // add a decorator which can access CustomObject instances | |
|
64 | PythonQt::self()->addDecorators(new CustomObjectWrapper()); | |
|
61 | // register the new object as a known classname and add it's wrapper object | |
|
62 | PythonQt::self()->registerCPPClass("CustomObject", "","", PythonQtCreateObject<CustomObjectWrapper>); | |
|
65 | 63 | |
|
66 | 64 | // ----------------------------------------------------------------- |
|
67 | 65 | // Alternative 2: make CustomObject2 known and use a wrapper factory for wrapping: |
@@ -72,7 +70,7 int main( int argc, char **argv ) | |||
|
72 | 70 | |
|
73 | 71 | // the following is optional and only needed if you want a constructor: |
|
74 | 72 | // register the new object as a known classname |
|
75 |
PythonQt::self()->registerCPPClass |
|
|
73 | PythonQt::self()->registerCPPClass("CustomObject2"); | |
|
76 | 74 | // add a constructor for CustomObject2 |
|
77 | 75 | PythonQt::self()->addClassDecorators(new CustomObject2Constructor()); |
|
78 | 76 |
@@ -57,7 +57,7 int main( int argc, char **argv ) | |||
|
57 | 57 | // register the type with QMetaType |
|
58 | 58 | qRegisterMetaType<CustomObject>("CustomObject"); |
|
59 | 59 | // add a wrapper object for the new variant type |
|
60 |
PythonQt::self()->registerCPP |
|
|
60 | PythonQt::self()->registerCPPClass("CustomObject","","", PythonQtCreateObject<CustomObjectWrapper>); | |
|
61 | 61 | |
|
62 | 62 | mainContext.evalFile(":example.py"); |
|
63 | 63 |
@@ -56,7 +56,7 int main( int argc, char **argv ) | |||
|
56 | 56 | |
|
57 | 57 | PythonQt::self()->addDecorators(new PyExampleDecorators()); |
|
58 | 58 | PythonQt::self()->registerClass(&QPushButton::staticMetaObject); |
|
59 |
PythonQt::self()->registerCPPClass |
|
|
59 | PythonQt::self()->registerCPPClass("YourCPPObject"); | |
|
60 | 60 | |
|
61 | 61 | mainContext.evalFile(":example.py"); |
|
62 | 62 |
@@ -41,6 +41,7 void PythonQt_init_QtWebKit(); | |||
|
41 | 41 | void PythonQt_init_QtOpenGL(); |
|
42 | 42 | void PythonQt_init_QtXml(); |
|
43 | 43 | void PythonQt_init_QtXmlPatterns(); |
|
44 | void PythonQt_init_QtUiTools(); | |
|
44 | 45 | //void PythonQt_init_QtPhonon(); |
|
45 | 46 | |
|
46 | 47 | namespace PythonQt_QtAll |
@@ -55,6 +56,7 namespace PythonQt_QtAll | |||
|
55 | 56 | PythonQt_init_QtSql(); |
|
56 | 57 | PythonQt_init_QtWebKit(); |
|
57 | 58 | PythonQt_init_QtOpenGL(); |
|
59 | PythonQt_init_QtUiTools(); | |
|
58 | 60 | // PythonQt_init_QtPhonon(); |
|
59 | 61 | }; |
|
60 | 62 | }; |
@@ -3,7 +3,6 TARGET = PythonQt_QtAll | |||
|
3 | 3 | TEMPLATE = lib |
|
4 | 4 | |
|
5 | 5 | DESTDIR = ../../lib |
|
6 | DLLDESTDIR = ../../lib | |
|
7 | 6 | |
|
8 | 7 | include ( ../../build/common.prf ) |
|
9 | 8 | include ( ../../build/PythonQt.prf ) |
@@ -18,6 +17,7 HEADERS += \ | |||
|
18 | 17 | SOURCES += \ |
|
19 | 18 | PythonQt_QtAll.cpp |
|
20 | 19 | |
|
20 | CONFIG += uitools | |
|
21 | 21 | QT += webkit gui svg sql network xml xmlpatterns opengl |
|
22 | 22 | #QT += phonon |
|
23 | 23 | |
@@ -30,5 +30,6 include (../../generated_cpp/com_trolltech_qt_opengl/com_trolltech_qt_opengl.pri | |||
|
30 | 30 | include (../../generated_cpp/com_trolltech_qt_webkit/com_trolltech_qt_webkit.pri) |
|
31 | 31 | include (../../generated_cpp/com_trolltech_qt_xml/com_trolltech_qt_xml.pri) |
|
32 | 32 | include (../../generated_cpp/com_trolltech_qt_xmlpatterns/com_trolltech_qt_xmlpatterns.pri) |
|
33 | include (../../generated_cpp/com_trolltech_qt_uitools/com_trolltech_qt_uitools.pri) | |
|
33 | 34 | |
|
34 | 35 | #include (../../generated_cpp/com_trolltech_qt_phonon/com_trolltech_qt_phonon.pri) |
General Comments 0
You need to be logged in to leave comments.
Login now