summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-03-20 15:55:57 +0100
committerAndy Nichols <andy.nichols@qt.io>2018-03-21 07:43:43 +0000
commit949ed8208526794c3b1b4ca4a8c8257ae3d55766 (patch)
tree426ed48e7cda31bea81366e4cfab4c2c7409cba6 /examples
parent679a302d4c113c9df26991778ef74e0a17af7f5b (diff)
simpleqml: Avoid buttons stealing keyboard focus
Change-Id: Ic093f3fc122b1c09ad82760e59dcd69ede550822 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/3dstudioruntime2/simpleqml/main.qml10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/3dstudioruntime2/simpleqml/main.qml b/examples/3dstudioruntime2/simpleqml/main.qml
index 1e5b203..27ba9ba 100644
--- a/examples/3dstudioruntime2/simpleqml/main.qml
+++ b/examples/3dstudioruntime2/simpleqml/main.qml
@@ -124,27 +124,33 @@ Rectangle {
Button {
text: "Move to other window"
onClicked: if (s3d.parent === wroot) s3d.parent = root; else s3d.parent = wroot
+ focusPolicy: Qt.NoFocus
}
Button {
text: "Open barrel without background"
onClicked: s3dpres.source = "qrc:/presentation/barrel_no_background.uip"
+ focusPolicy: Qt.NoFocus
}
Button {
text: "Animate opacity"
onClicked: opacityAnimation.running = true
+ focusPolicy: Qt.NoFocus
}
Button {
text: "Reload"
onClicked: s3dpres.reload()
+ focusPolicy: Qt.NoFocus
}
Button {
text: "Open"
onClicked: openDialog.open()
+ focusPolicy: Qt.NoFocus
}
CheckBox {
id: mouseEvCb
text: "Let mouse events through"
checked: true
+ focusPolicy: Qt.NoFocus
}
Button {
text: "Fire event"
@@ -152,6 +158,7 @@ Rectangle {
// name but creating a working dialog with Quick Controls 2 is way
// beyond my modest skills, apparently.
onClicked: s3dpres.fireEvent("Scene.Layer.Camera", "customCameraEvent") // in actionevent.uip this will change the sphere's color
+ focusPolicy: Qt.NoFocus
}
Button {
text: "Toggle camera"
@@ -159,6 +166,7 @@ Rectangle {
var v = s3dpres.getAttribute("Scene.Layer.Camera", "eyeball")
s3dpres.setAttribute("Scene.Layer.Camera", "eyeball", !v)
}
+ focusPolicy: Qt.NoFocus
}
}
@@ -192,12 +200,14 @@ Rectangle {
anchors.left: parent.left
anchors.bottom: fpsCount.top
onClicked: s3dpres.goToSlide("Scene", true, true)
+ focusPolicy: Qt.NoFocus
}
Button {
text: "Seek to 5 seconds"
anchors.left: nextSlideByIndex.right
anchors.bottom: fpsCount.top
onClicked: s3dpres.goToTime("Scene", 5)
+ focusPolicy: Qt.NoFocus
}
FileDialog {