Closed 1VanillaGorilla closed 7 months ago
qmlRegisterUncreatableMetaObject(SCodes::staticMetaObject, // meta object created by Q_NAMESPACE macro
"com.scythestudio.scodes", // import statement (can be any string)
1, 0, // major and minor version of the import
"SCodes", // name in QML (does not have to match C++ name)
"Error: only enums" // error in case someone tries to create a MyNamespace object
);
Hey guys,
first of all: awesome tool you have created there!
Unfortunately there is a minor issue with your README file. You explain that to try various formats one just would have to add the following code:
Component.onCompleted: { barcodeFilter.format = SCodes.OneDCodes }
That may be correct but the namespace SCodes has not been exposed to QML anywhere. I've also checked the example QmlBarcodeReader and did not find any registration code for that namespace either.
The only thing one has to do to make that example work is to add the following lines:
qmlRegisterUncreatableMetaObject( SCodes::staticMetaObject, // meta object created by Q_NAMESPACE macro "SBarcodeFilter.scodes", // import statement (can be any string) 1, 0, // major and minor version of the import "SCodes", // name in QML (does not have to match C++ name) "Error: only enums" // error in case someone tries to create a MyNamespace object );
The name of the import statement is just an example of course and can be changed to your needs accordingly.