I'm trying to catch a signal of a ListView in my .qml file, so I'm doing:
ListView *userList = root->findChild<ListView*>("userList");
Q_ASSERT(userList);
It gets the list, and the when I try:
Q_ASSERT(connect(userList, SIGNAL(triggered(QVariantList indexPath)), this, SLOT(onUserListTriggered(QVariantList indexPath))));
I get this error:
Object::connect: No such signal bb::cascades::QmlListView::triggered(QVariantList indexPath)
Object::connect: (sender name: 'userList')
ASSERT: "connect(userList, SIGNAL(triggered(QVariantList indexPath)), this, SLOT(onUserListTriggered(QVariantList indexPath)))"
It makes no sense. The documentation of ListView tells the class emits this signal, and I can see it in the header listview.h as
Q_SIGNALS:
/*!
* @brief Emitted when a list item is triggered by the user.
*
* Typically, this signal is emitted when an item is tapped by the user
* with the intention to execute some action associated with it.
* This signal is, for example, not emitted when items are tapped
* during multiple selection, where the intention is to select the
* tapped item and not trigger an action associated with it.
*
* @param indexPath Index path to the triggered item.
*/
void triggered(QVariantList indexPath);