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

Posts: 20
Registered: ‎02-21-2012
My Device: Bold 9900
My Carrier: AT&T

Access Sheet loaded from attachedObject

[ Edited ]

I have two QML files: main.qml and addData.qml. "addData.qml" is a Sheet, and main.qml has a button that opens the sheet through attachedObject. "addData.qml" has a signal sending an integer back to main.qml and then to the main CPP class.

The purpose is to dynamically update the sheet.


The QML:

Page {
    Container {
        objectName: "mainContainer"
        layout: DockLayout {}
        Button {
            property variant addSheet
            // removed
            onClicked: {
                // Create the add sheet and connect to its signals.
                // removed
            attachedObjects: [
                ComponentDefinition {
                    id: addGameSheet
                    objectName: "addGameSheet"
                    source: "addData.qml"
// removed } } function addDropDowns(index) { main.setSelect(index); } } The C++: void TennisScoreKeeper::setSelect(int index) {

// This is found Container *main = root->findChild<Container*>("mainContainer");

// This is the componentDefinition, but it doesn't help me. QObject *componentDef = main->findChild<QObject*>("addGameSheet");

// This doesn't work. The ComponentDefinition loaded the sheet though Sheet *sheet = componentDef->findChild<Sheet*>("addSheet");

// This doesn't work because sheet doesn't work Container *container = sheet->findChild<Container*>("scrollViewContainer"); } } }