I am developing a BlackBerry 10 mobile application using the Momentics IDE (native SDK).
I have a listview that I want to process with my elements by clicking on C ++ (I need to use C ++, not QML).
I can get the pointer path using the "connect" command, but I have a problem parsing QVariant into a user class;
Q_ASSERT(QObject::connect(list1, SIGNAL(triggered(QVariantList)), this, SLOT(openSheet(QVariantList)))); QVariant selectItem = m_categoriesListDataModel->data(indexPath);
I tried using a static cast as shown below
Category* custType = static_cast<Category*>(selectItem);
but it returns:
"invalid static_cast from type 'QVariant' to type 'Category*'"
Can someone help me with this?
c ++ qt cascade qvariant blackberry-10
Jmj
source share