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
New Contributor
Posts: 9
Registered: ‎04-16-2013
My Device: BB 10 Developer
My Carrier: --
Accepted Solution

NavigationPane properties and objectName explanation

Hello everyone!

 

I've been working with a variety of the sample apps that use NavigationPane objects (in QML) and have noticed that sometimes, the pages and/or lists that are within the NavigationPane look like properties of the pane:

 

NavigationPane {

    id: navigationPane

    firstPage: Page {

        id: pgMain

        content: Container {

            ListView {

                id: listView

                // set object name to let listView to be discoverable from C++

                objectName: "listView"

                layout: GridListLayout{}

                ...

 

Then, other times, the words I bolded simply aren't there.  Does this make a difference or have any significance? Also, when and why do you use "objectName?"  I have looked through the documentation on both of these topics and not found much explanation.

Developer
Posts: 656
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Re: NavigationPane properties and objectName explanation

I don't put the firstpage or content and all works fine.

 

As for objectname.... You need that when trying get a pointer to that object from cpp



 


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
New Contributor
Posts: 9
Registered: ‎04-16-2013
My Device: BB 10 Developer
My Carrier: --

Re: NavigationPane properties and objectName explanation

Thanks for the insight with objectName!
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: NavigationPane properties and objectName explanation

objectName can also be used in QML, for example, when iterating children of a container to distinguish them.

 

firstPage and content are default properties. If property name is omitted, the children of the element will be binded to a default property (if there's one defined). More info on this:

http://qt-project.org/doc/qt-4.8/propertybinding.html#default-properties

Or even better example from Qt 5 docs (it still applies to 4.8):

http://qt-project.org/doc/qt-5.0/qtqml/qtqml-syntax-objectattributes.html#default-properties

 

 


Andrey Fidrya, @zmeyc on twitter