diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2014-10-01 13:41:37 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@digia.com> | 2014-10-02 07:48:52 +0200 |
commit | 85f57be3a096cc4f580f30e0eb59de3747f3da03 (patch) | |
tree | 11cf282e72732cdac65cc0e61ac941725fe38c86 /qtquickcontrols.pro | |
parent | 4d851e14ebf0ec9bbfd899e71fe95c18ea1e658d (diff) | |
download | qtquickcontrols-85f57be3a096cc4f580f30e0eb59de3747f3da03.tar.gz |
ApplicationWindow: top level items must get focus when they ask for it.
Currently, the following Item will not receive any key events:
import QtQuick 2.2
import QtQuick.Controls 1.2
ApplicationWindow {
visible: true
width: 200
height: 200
Item {
focus: true
anchors.fill: parent
Keys.onLeftPressed: textItem.text = "Left"
Keys.onRightPressed: textItem.text = "Right"
Keys.onPressed: {
if (event.key === Qt.Key_Home) {
textItem.text = "Home";
} else if (event.key === Qt.Key_End) {
textItem.text = "End";
}
}
Text {
id: textItem
anchors.centerIn: parent
}
}
}
Using Window instead of ApplicationWindow does, however.
ApplicationWindow can behave the same if we ensure that the panel has
focus set to true. When the panel has focus, the contentItem can
receive focus.
[ChangeLog][ApplicationWindow] Top level items now receive focus when
their focus property is set to true, in the same way that top level
items of Window do.
Change-Id: I16ef1632fc6df1989015e62e8683b6cd7c5be8a6
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'qtquickcontrols.pro')
0 files changed, 0 insertions, 0 deletions