##// END OF EJS Templates
fixed example for 2.0 API...
florianlink -
r151:a5a8aa72950d
parent child
Show More
1 NO CONTENT: modified file
NO CONTENT: modified file
@@ -1,4 +1,4
1 from PythonQt import CustomObject
1 from PythonQt.example import CustomObject
2
2
3 # create a new object
3 # create a new object
4 custom = CustomObject("John","Doe")
4 custom = CustomObject("John","Doe")
@@ -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()->registerCPPClass("CustomObject","","", PythonQtCreateObject<CustomObjectWrapper>);
60 PythonQt::self()->registerCPPClass("CustomObject","","example", PythonQtCreateObject<CustomObjectWrapper>);
61
61
62 mainContext.evalFile(":example.py");
62 mainContext.evalFile(":example.py");
63
63
General Comments 0
You need to be logged in to leave comments. Login now