Skip to content

Commit ee3a5fe

Browse files
author
florianlink
committed
fixed example for 2.0 API, factory example still not working
git-svn-id: https://pythonqt.svn.sourceforge.net/svnroot/pythonqt/trunk@191 ea8d5007-eb21-0410-b261-ccb3ea6e24a9
1 parent 014a1e9 commit ee3a5fe

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

examples/PyCPPWrapperExample/PyCPPWrapperExample.qrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE RCC><RCC version="1.0">
1+
<!DOCTYPE RCC><RCC version="1.0">
22
<qresource>
33
<file>example.py</file>
44
</qresource>

examples/PyCPPWrapperExample/example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from PythonQt import *
1+
from PythonQt.example import *
22

33
print "alternative 1 : CustomObject wrapped by decorators"
44

examples/PyCPPWrapperExample/main.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int main( int argc, char **argv )
5959
// -----------------------------------------------------------------
6060

6161
// 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>);
6363

6464
// -----------------------------------------------------------------
6565
// Alternative 2: make CustomObject2 known and use a wrapper factory for wrapping:
@@ -70,7 +70,7 @@ int main( int argc, char **argv )
7070

7171
// the following is optional and only needed if you want a constructor:
7272
// register the new object as a known classname
73-
PythonQt::self()->registerCPPClass("CustomObject2");
73+
PythonQt::self()->registerCPPClass("CustomObject2", "", "example");
7474
// add a constructor for CustomObject2
7575
PythonQt::self()->addClassDecorators(new CustomObject2Constructor());
7676

0 commit comments

Comments
 (0)