Commit 7b6f5708 authored by Jason Erb's avatar Jason Erb Committed by Jason Erb (Suitable Technologies)
Browse files

Made Button accept space key press and release events


Task-number: QTBUG-57853
Change-Id: I33cd09d78e470a85d0f816781e683b7574f673ab
Reviewed-by: default avatarJ-P Nurmi <jpnurmi@qt.io>
Showing with 4 additions and 1 deletion
......@@ -167,8 +167,10 @@ Control {
activeFocusOnTab: true
Keys.onPressed: {
if (event.key === Qt.Key_Space && !event.isAutoRepeat && !behavior.pressed)
if (event.key === Qt.Key_Space && !event.isAutoRepeat && !behavior.pressed) {
behavior.keyPressed = true;
event.accepted = true;
}
}
onFocusChanged: if (!focus) behavior.keyPressed = false
......@@ -178,6 +180,7 @@ Control {
behavior.keyPressed = false;
__action.trigger(button)
behavior.toggle()
event.accepted = true;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment