How can I call a pointer of an QObject in a QML File?

前端 未结 2 1440
离开以前
离开以前 2021-01-14 04:08

I\'m developping an application for Blackberry 10 and I\'m using the Momentics IDE (BB native SDK).

I get the following error when I try to execute the code below. A

2条回答
  •  忘掉有多难
    2021-01-14 04:59

    DataHandler is unknown type.

    Q_PROPERTY docu says:

    The type can be any type supported by QVariant

    I'd try to encapsulate your DataHandler* in QVariant and make the property of type QVariant.

    You could create the value containing your DataHandler pointer e.g like this:

    const int DATA_HANDLER = QVariant::UserType +1;
    //...
    QVariant dataHandler( DATA_HANDLER, myDataHandlerPointer );
    

提交回复
热议问题