Custom QML control... If I can have a property?

Hello

I created a simple custom control, but I want to be able to adjust the height of it when I create.

Now I can put the preferredHeight of each child control of the custom control, but it seems wrong.

According to me, I have to set a property on the control, then all my child controls use this to set their height.

But I can't find examples like this one or a reference to a custom; property can I create my own property to store in qml, then child controls (buttons, images) use this property to set their height?

Thanks in advance

You can do this kind of things. Sorry I don't have a reference of the GLib documentation:

import bb.cascades 1.0

Container {
    id: root
    property real height: Infinity

    Label {
        text: "My Label"
        preferredHeight: root.height
    }

    Container {
        background: Color.Red
        preferredHeight: root.height
    }
}

It is obviously an artificial example, but it should help you get started.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • How can I get rid of the boxes that appear when I visit a show that isn't in English?

    I do a lot of browsing, but sites that go for the most part are in Japanese and instead to see the real kana I see just weird boxes... I downloaded the Japanese language pack, but it is not always fill them with the real... written language just boxe

  • Wrong BIOS in the support page for Satellite A300D

    Hi allHalf an hour ago, I was searching a driver for my a300d and I found a new bios version 2.80 - win64 02/10/12latest version of the bios is 3.30 in 2009new versions are always with a greater number... and never after almost 3 yearsI'm not stupid

  • OfficeJet 4630 does not print on the network

    My printer print is no longer on a network connection, a USB connection. For example, when I try printer in MS Word, the menu of the printer displays "Unable connect", even though I'm perfectly connected to my printer. I've had this printer for about

  • OWA with modern mail?

    So I bought an Asus Rivo RT with Windows 8 RT and I didn't what lucky so ever in getting my company change to talk to the mail app in modern interface.  Although I am able to set up my account to mail2web personal activesync in the application withou

  • How can I see file published evaluation of simulation results in a non - LMS?

    How can I see file published evaluation of simulation results in a non - LMS?I created the demo, training and evaluation. I don't know how to get the results of the evaluation at the end of the assessment.