Hi, I loaded 1 Qml file using qdecllarativeView and send signals to that Qml file from cpp.
At the QML side I received the signal correctly. Then I closed that qml and loaded another one and send the same signal. Now I'm not getting that signal in the second qml and also getting it in the fist qml.. How can I disconnect signals correctly. my sample code is :
view = new QDeclarativeView();
view
->setSource
(QUrl::fromLocalFile(filename
));
view->show();
Qmlview->close();
Qmlview = view;
update();
emit signal_object2(value);
view = new QDeclarativeView();
view->setSource(QUrl::fromLocalFile(filename));
view->show();
Qmlview->close();
Qmlview = view;
update();
emit signal_object2(value);
To copy to clipboard, switch view to plain text mode
and at the qml side :
Connections
{
target: linkFile
onSignal_object2:
{
console.log("Got event ## ## onSignal_object1:")
}
}
Connections
{
target: linkFile
onSignal_object2:
{
console.log("Got event ## ## onSignal_object1:")
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks