Stunts by the way of GroupDataModel of c ++ qml problem!

Hello

I'm trying to access the data of GroupDataModel of c ++ to qml!

I tried,

in PHP,.

public Q_SLOTS:

BB::Cascades:GroupDataModel load_datamodel (const QString & txprofile);

in the PRC,

BB::Cascades:GroupDataModel ApplicationUI::load_datamodel (const QString & txprofile)

{

Model GroupDataModel;

.......

model.insertList (()) list.value;

return the template;

}

But it's not working! Please help me!

I guess that you see no changes when the DataModel is updated?  I recommend to expose to as a Q_PROPERTY QML like this:

Q_PROPERTY(bb::cascades::DataModel* model READ model NOTIFY dataModelChanged)

public:

    YourClass(QObject *parent = 0);

Q_SIGNALS:

    /*
     * This signal is emitted the data model is updated.
     */
    void dataModelChanged();

private:

    bb::cascades::DataModel* model() const;

    bb::cascades::GroupDataModel* mDataModel;

Side C++ you can then pull the signal of dataModelChanged after the model has been changed and you want to update your user interface.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for