Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 45
Registered: ‎01-18-2013
My Device: 9000
My Carrier: CMCC

how to open sheet in qml file with C++ code?

i have a sheet in a qml file,how to open the sheet in C++ code?

Developer
Posts: 19
Registered: ‎07-02-2013
My Device: BlackBerry Q10
My Carrier: Telus

Re: how to open sheet in qml file with C++ code?

How about:

 

QmlDocument* qml = QmlDocument::create("asset:///SheetQmlNameGoesHere.qml").parent(this);

Sheet* root = qml->createRootObject<Sheet>();

 

root->open();

Developer
Posts: 16,999
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: how to open sheet in qml file with C++ code?

if the sheet already exists you can use findChild to retrieve a reference to it and call open().

or you could send a signal from c++ to qml and handle the sheet there.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 45
Registered: ‎01-18-2013
My Device: 9000
My Carrier: CMCC

Re: how to open sheet in qml file with C++ code?

Thanks a lot!