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

Reply
uy
New Contributor
Posts: 5
Registered: ‎01-28-2013
My Device: blackberry10
My Carrier: Blackberry

Not able to call .cpp function from inside the ListViewItem { } component in QML

In cascades application I am using qml as a UI Interface .In qml we have ListViewItem{} component inside this i want to call a function i.e. written in .cpp file .But i am not able to call the .cpp function from ListViewItem.

 

Pl help me how to call .cpp function inside ListViewItem.: No: 

 

example:

 

ListView {

property variant itemTextStyle: defaultBlackTextStyle
dataModel: XmlDataModel {


source: "models/xyz.xml"
}
listItemComponents: [
ListItemComponent {
type: "header"

Container {
background: Color.create("#E0E0E0") //it is very important
leftPadding: 20
topPadding: 25
rightPadding: 0
bottomPadding: 0
preferredWidth: 768
preferredHeight: 50
Label {

text: app.getRandomNumber().//////////////////////////////////here it is failing i am not able to call this function i.e. written in .cpp file

}

Highlighted
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Not able to call .cpp function from inside the ListViewItem { } component in QML