1

I am starting to develop for my shiny new BB10 Dev Alpha B with Cascades (Doubt i can implement a fully-functional Mp3 player on WebWorks, even though i'd really like to) and i've been trying to make QML and C++ play nicely as described in https://developer.blackberry.com/cascades/documentation/dev/integrating_cpp_qml/index.html but no matter where i put

property alias artistText: artist.Text

the QNX Momentics IDE complains about it being on an invalid place. I have not found any guidelines on where said properties ought be so i decided to ask here.

import bb.cascades 1.0

Page {
    actionBarVisibility: ChromeVisibility.Visible
    Container {
        layout: DockLayout {

        }
        Button {
            text: "Random"
            verticalAlignment: VerticalAlignment.Top
        }
        Button {
            text: "Repeat"
            horizontalAlignment: HorizontalAlignment.Right
        }
        Container {
            verticalAlignment: VerticalAlignment.Center
            ImageView {
                preferredWidth: 615.0
                preferredHeight: 615.0
                minWidth: 615.0
                minHeight: 615.0
                maxWidth: 615.0
                maxHeight: 615.0
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
                imageSource: "asset:///test.jpg"
            }
            Container {
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Bottom
                topMargin: 60.0
                Label {
                    id: artist
                    text: "Artist"
                    horizontalAlignment: HorizontalAlignment.Center
                }
                Label {
                    id: song
                    text: "Track"
                    horizontalAlignment: HorizontalAlignment.Center
                }
                Label {
                    id: album
                    text: "Album"
                    horizontalAlignment: HorizontalAlignment.Center
                }
                Container {
                    layout: StackLayout {
                        orientation: LayoutOrientation.LeftToRight
                    }
                    Button {
                        text: "Previous"
                    }
                    Button {
                        text: "Pause"
                    }
                    Button {
                        text: "Next"
                    }
                }
                Slider {
                    verticalAlignment: VerticalAlignment.Bottom
                    horizontalAlignment: HorizontalAlignment.Center
                    fromValue: 0
                    toValue: 100
                }
            }
        }
    }
}
Machinarius
  • 3,637
  • 3
  • 30
  • 53

1 Answers1

3

I still not completely sure what you want to achieve, but if you want define an alias property for the text property of the artist item you made simple spelling error: property alias artistText: artist.text is the correct way to define the alias. The second part of the alias definition (the part after the dot) indicates the target property, these usually start with a lower case letter.

sebasgo
  • 3,845
  • 23
  • 28