J.M*_*M.J 3 c++ qt blackberry qml blackberry-10
我正在为Blackberry 10开发应用程序,而我正在使用Momentics IDE(BB原生SDK).
当我尝试执行下面的代码时出现以下错误.任何人都知道如何解决这个问题?
错误
QMetaProperty::read: Unable to handle unregistered datatype 'DataHandler*' for property 'xxx::dataHandler'
asset:///main.qml:104: TypeError: Result of expression 'xxx.dataHandler' [undefined] is not an object.
Process 627863799 (xxx) terminated SIGSEGV code=1 fltno=11 ip=08055b30(/accounts/1000/appdata/com.ddd.xxx.testDev_e_xxx45b0f435/app/native/xxx@main+0x5d63) ref=006e0075
Run Code Online (Sandbox Code Playgroud)
**xxx.hpp**
class xxx: public QObject {
Q_OBJECT
Q_PROPERTY(DataHandler* dataHandler READ getDataHandler)
public:
xxx(bb::cascades::Application *app);
virtual ~xxx() {
}
Q_INVOKABLE
DataHandler* getDataHandler() const;
private:
DataHandler* m_dataHandler;
}
Run Code Online (Sandbox Code Playgroud)
**xxx.cpp**
xxx::xxx(bb::cascades::Application *app) :
QObject(app) {
m_dataHandler = new DataHandler();
}
Run Code Online (Sandbox Code Playgroud)
**QML文件**
Button {
id: backBtn
objectName: "backBtnObject"
text: qsTr("Back") + Retranslate.onLocaleOrLanguageChanged
preferredWidth: backBtn.text.length
visible: false
onClicked: {
xxx.dataHandler.displayLicencesList();
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3443 次 |
| 最近记录: |