From d0d61419dda485d6ec1294619040f64f6e3827b1 2010-05-29 18:22:05 From: florianlink Date: 2010-05-29 18:22:05 Subject: [PATCH] fixed example for 2.0 API, factory example still not working git-svn-id: svn://svn.code.sf.net/p/pythonqt/code/trunk@191 ea8d5007-eb21-0410-b261-ccb3ea6e24a9 --- diff --git a/examples/PyCPPWrapperExample/PyCPPWrapperExample.qrc b/examples/PyCPPWrapperExample/PyCPPWrapperExample.qrc index 0e28080..305aed1 100644 --- a/examples/PyCPPWrapperExample/PyCPPWrapperExample.qrc +++ b/examples/PyCPPWrapperExample/PyCPPWrapperExample.qrc @@ -1,4 +1,4 @@ - + example.py diff --git a/examples/PyCPPWrapperExample/example.py b/examples/PyCPPWrapperExample/example.py index e31da13..ffb4f77 100644 --- a/examples/PyCPPWrapperExample/example.py +++ b/examples/PyCPPWrapperExample/example.py @@ -1,4 +1,4 @@ -from PythonQt import * +from PythonQt.example import * print "alternative 1 : CustomObject wrapped by decorators" diff --git a/examples/PyCPPWrapperExample/main.cpp b/examples/PyCPPWrapperExample/main.cpp index ba8589e..3214c3e 100644 --- a/examples/PyCPPWrapperExample/main.cpp +++ b/examples/PyCPPWrapperExample/main.cpp @@ -59,7 +59,7 @@ int main( int argc, char **argv ) // ----------------------------------------------------------------- // register the new object as a known classname and add it's wrapper object - PythonQt::self()->registerCPPClass("CustomObject", "","", PythonQtCreateObject); + PythonQt::self()->registerCPPClass("CustomObject", "","example", PythonQtCreateObject); // ----------------------------------------------------------------- // Alternative 2: make CustomObject2 known and use a wrapper factory for wrapping: @@ -70,7 +70,7 @@ int main( int argc, char **argv ) // the following is optional and only needed if you want a constructor: // register the new object as a known classname - PythonQt::self()->registerCPPClass("CustomObject2"); + PythonQt::self()->registerCPPClass("CustomObject2", "", "example"); // add a constructor for CustomObject2 PythonQt::self()->addClassDecorators(new CustomObject2Constructor());