Adding escape shortcut for base dialog.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
40743e54c3
commit
09c1a44150
1 changed files with 6 additions and 1 deletions
|
@ -28,6 +28,7 @@ import QtQuick.Controls
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Window {
|
Window {
|
||||||
|
id: base
|
||||||
color: sysPalette.window
|
color: sysPalette.window
|
||||||
visible: false;
|
visible: false;
|
||||||
flags: Qt.Dialog | Qt.Popup | Qt.MSWindowsFixedSizeDialogHint
|
flags: Qt.Dialog | Qt.Popup | Qt.MSWindowsFixedSizeDialogHint
|
||||||
|
@ -35,7 +36,6 @@ Window {
|
||||||
minimumWidth: width
|
minimumWidth: width
|
||||||
maximumWidth: width
|
maximumWidth: width
|
||||||
height: minimumHeight
|
height: minimumHeight
|
||||||
// maximumHeight: contentItem.implicitHeight + 2*margin
|
|
||||||
property int margin: 10
|
property int margin: 10
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
@ -48,6 +48,11 @@ Window {
|
||||||
onClicked: close()
|
onClicked: close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Shortcut {
|
||||||
|
sequence: "Esc"
|
||||||
|
onActivated: base.close()
|
||||||
|
}
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
show()
|
show()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue