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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Where should I call qmlRegisterType

[ Edited ]

@Zmey LOL, Great minds think alike! Smiley Happy

 

[Edit] Wouldn't it be nice to have some real-time indicator that informs you while editing a post that the thread has changed, it would be so useful on occasions. Smiley Happy

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Where should I call qmlRegisterType

According to the development adviser who posted about enums you should use qmlRegisterUncreatableType to register them.
Works fine for me.

 

example:

in c++

qmlRegisterUncreatableType<Sensitivity>("com.isec7.materials", 1, 0, "Sensitivity", "Sensitivity provides enum values. It cannot be instantiated.");

 in qml:

editedAppointment.sensitivity = Sensitivity.Private

 

----------------------------------------------------------
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
Developer
Posts: 1,178
Registered: ‎03-20-2013
My Device: Red LE Developer Z10
My Carrier: Fido

Re: Where should I call qmlRegisterType

Yep, this is what I do in my app too. Doing it this way prevents a developer from accidentally trying to instantiate the enum class. Unfortunately I only learned about this from Qt documentation. The Cascades docs currently don't cover much in-depth QML functionality. Qt is actually far more powerful than Cascades would lead you to believe.

 


simon_hain wrote:

According to the development adviser who posted about enums you should use qmlRegisterUncreatableType to register them.
Works fine for me.

 

example:

in c++

qmlRegisterUncreatableType<Sensitivity>("com.isec7.materials", 1, 0, "Sensitivity", "Sensitivity provides enum values. It cannot be instantiated.");

 in qml:

editedAppointment.sensitivity = Sensitivity.Private

 






Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.  multiFEED Icon

Play nice: Clicking Like Button on posts that helped you not only encourages others to continue sharing their experience, but also improves your own rating on this board. Also, don't forget to accept a post if it solves your problem or answers your question.