Created
November 5, 2014 23:53
-
-
Save webmaster128/c0724440033ef153bb96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.3 | |
import QtQuick.Controls 1.1 | |
import QtQuick.Window 2.1 | |
ApplicationWindow { | |
visible: true | |
width: 300 | |
height: 300 | |
title: qsTr("Hello World") | |
Window { | |
id: childWindow | |
title: qsTr("Child Window") | |
visible: true | |
width: 200 | |
height: 200 | |
onClosing: { | |
console.log("Child window is closing …") | |
close.accepted = false | |
} | |
function close() { | |
var closeEvent = { accepted: true }; | |
childWindow.closing(closeEvent) | |
if (closeEvent.accepted) | |
{ | |
visible = false | |
} | |
else | |
{ | |
console.log("Closing denied") | |
} | |
} | |
Column { | |
anchors.centerIn: parent | |
Button { | |
text: qsTr("Run close()") | |
onClicked: childWindow.close() | |
} | |
Button { | |
text: qsTr("Set visible = false") | |
onClicked: childWindow.visible = false | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment