I am trying to connect a signal from QML to a SLOT from Qt. The signal passes a QList variable.
QML:
property var cases: ["A", "B", "C"]
signal casesClicked(list cases)
Qt:
d->m_view->setSource(QUrl("qrc:/qml/main.qml"));
d->m_item = d->m_view->rootObject();
QObject::connect(d->m_item, SIGNAL(casesClicked(QList<QString>)), this, SLOT(onCasesClicked(QList<QString>)));
The issue I am having is that I don't know how to declare QList from the QML side, so it is taken directly. If I declare it with:
signal casesClicked(var cases)
then, the signal is not connected, and I if I declare it as a list or an Array it says "Invalid signal parameter type: list/Array"
Any tip? I don't have any problems with single int, bool or string. Thanks,