I use QML to build GUI in my app + simple logics. At some step I open dialog and after closing it I want to get back a result value. This is sample code:
Button {
id: myButton
onClicked: {
var component = Qt.createComponent("Dialog.qml");
if (component.status === Component.Ready) {
var dialog = component.createObject(parent);
dialog.show();
dialog.onClosing: {} // that not works
}
}
}
Dialog.qml:
import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Controls 1.1
Window {
id: dialogWindow
width: 800
height: 600
flags: Qt.Dialog
Button {
id: closeButton
onClicked: {
dialogWindow.close();
}
}
}
But I have no idea how can I get some return value after the dialog was closed.