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