@@ -1,4 +1,4 | |||
|
1 |
|
|
|
1 | <!DOCTYPE RCC><RCC version="1.0"> | |
|
2 | 2 | <qresource> |
|
3 | 3 | <file>example.py</file> |
|
4 | 4 | </qresource> |
@@ -1,4 +1,4 | |||
|
1 | from PythonQt import * | |
|
1 | from PythonQt.example import * | |
|
2 | 2 | |
|
3 | 3 | print "alternative 1 : CustomObject wrapped by decorators" |
|
4 | 4 |
@@ -59,7 +59,7 int main( int argc, char **argv ) | |||
|
59 | 59 | // ----------------------------------------------------------------- |
|
60 | 60 | |
|
61 | 61 | // register the new object as a known classname and add it's wrapper object |
|
62 | PythonQt::self()->registerCPPClass("CustomObject", "","", PythonQtCreateObject<CustomObjectWrapper>); | |
|
62 | PythonQt::self()->registerCPPClass("CustomObject", "","example", PythonQtCreateObject<CustomObjectWrapper>); | |
|
63 | 63 | |
|
64 | 64 | // ----------------------------------------------------------------- |
|
65 | 65 | // Alternative 2: make CustomObject2 known and use a wrapper factory for wrapping: |
@@ -70,7 +70,7 int main( int argc, char **argv ) | |||
|
70 | 70 | |
|
71 | 71 | // the following is optional and only needed if you want a constructor: |
|
72 | 72 | // register the new object as a known classname |
|
73 | PythonQt::self()->registerCPPClass("CustomObject2"); | |
|
73 | PythonQt::self()->registerCPPClass("CustomObject2", "", "example"); | |
|
74 | 74 | // add a constructor for CustomObject2 |
|
75 | 75 | PythonQt::self()->addClassDecorators(new CustomObject2Constructor()); |
|
76 | 76 |
General Comments 0
You need to be logged in to leave comments.
Login now