Thanks, it worked! I was inane enough to use "this" instead of the id of ApplicationWindow.
I am curious though, as to how this could be implemented in QML + C++. Please guide me if you know that.
Also, I want a value (access token, to be specific) back from the child window. How do you suggest I do that? My thought was to add a property to the child window: access_token, which I might access in the parent window before closing the child window.
Do you have a better suggestion?
[quote author="stevenceuppens" date="1375278713"]Hi Bhoot,
you can try this,
AuthorizationBrowser.qml
@
import QtQuick 2.0
import QtQuick.Window 2.1 // needed for the Window component
Window {
width: 300
height: 200
Rectangle {
anchors.fill: parent
color: "lightGrey"
Text {
anchors.centerIn: parent
text: "My New Window"
}
}
}
@
main.qml
@
import QtQuick 2.0
Rectangle {
id: root
width: 360
height: 360
property variant win; // you can hold this as a reference..
Text {
text: "Click here to open new window!"
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: {
var component = Qt.createComponent("AuthorizationBrowser.qml");
win = component.createObject(root);
win.show();
}
}
}
@[/quote]