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

Regular Contributor
Posts: 75
Registered: ‎11-30-2012
My Device: curve
My Carrier: airtel
Accepted Solution

Simple QML app



I created a empty cascade project in QNX, this prints ' Hello World ', when the app is launched.


Now instead of "Hello World" , I want to print some system info like "Hrdware Id", I wrote the below code in the main.QML... but no success Smiley Sad


Can some one point how to do this.?



import bb.cascades 1.0
import bb.device 1.1
import bb 1.0

// creates one page with a label
Page {
    Container {
        attachedObjects: [
                          HardwareInfo {
                                            id: hInfo
        layout: DockLayout {}
        Label {
            text: qsTr(hInfo.hardwareId())
            textStyle.base: SystemDefaults.TextStyles.BigText
            verticalAlignment: VerticalAlignment.Center
            horizontalAlignment: HorizontalAlignment.Center

Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Simple QML app

the post would be better situated in the cascades forum.

did you include the matching lib?
see the api docs:
To link against this class, add the following line to your .pro file : LIBS += -lbbdevice
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
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Simple QML app

that information is also probably a property and not an invokable method, so youd just want to access it like hInfo.hardwareId
Like all of my posts