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
Developer
Posts: 196
Registered: ‎12-14-2009
My Device: Not Specified

How to read a ListView clearSelection () signal parameters?

For ListView one can programattically do a clearSelection():

 

"This function does not cause signals to be emitted for individual items. Instead, a singleselectionChanged() is emitted with ListView::AllItems and false as parameters."

 

http://developer.blackberry.com/cascades/reference/bb__cascades__listview.html#function-clearselecti...

 

How can I listen for this when clearSelection() is called at onSelectionChanged?

 

Something like:

 

onSelectionChanged:{
if((!selected)&&(indexPath == listViewid.AllItems)){
//do something
}
}

 

I don't understand " Instead, a singleselectionChanged() is emitted with ListView::AllItems and false as parameters" and how to listen for those paramters.

 

 

Developer
Posts: 41
Registered: ‎02-06-2013
My Device: Developer - BB10 Dev B
My Carrier: Rogers

Re: How to read a ListView clearSelection () signal parameters?

easiest to see in C++

 

 

connect(m_listView,SIGNAL(selectionChanged),this,SLOT(handleSelectionChanged))

...

void MyApp::handleSelectionChanged (QVariantList indexPath, bool selected){
    if ((indexPath == ListView::AllItems) && (selected == false)){
         // clear selection was called
    }
}

 

 

Developer
Posts: 196
Registered: ‎12-14-2009
My Device: Not Specified

Re: How to read a ListView clearSelection () signal parameters?

Do you know the QML version?