aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/photoviewer
diff options
context:
space:
mode:
authorNiels Weber <niels.weber@digia.com>2014-05-22 17:02:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-27 11:27:16 +0200
commitcc27d274f2b534b5064aca86c6faa259560a33cb (patch)
tree16da6b79c7facf47a4820a477146abbeb21c5e5e /examples/quick/demos/photoviewer
parenta949f798730341bb5014ea38ef844a3de70481ff (diff)
Photoviewer: Allow using the Android back button to go back.
Don't show back button on Android, as the system back button can now be used. Task-number: QTBUG-38122 Change-Id: Ia3a677f4626eaf34e23dfcc7997e4b850d8b7020 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Diffstat (limited to 'examples/quick/demos/photoviewer')
-rw-r--r--examples/quick/demos/photoviewer/main.qml18
1 files changed, 17 insertions, 1 deletions
diff --git a/examples/quick/demos/photoviewer/main.qml b/examples/quick/demos/photoviewer/main.qml
index f443b70762..cbafb0112a 100644
--- a/examples/quick/demos/photoviewer/main.qml
+++ b/examples/quick/demos/photoviewer/main.qml
@@ -49,6 +49,15 @@ ApplicationWindow {
visible: true
+ Rectangle {
+ focus: true
+
+ Keys.onBackPressed: {
+ event.accepted = true
+ backButton.clicked()
+ }
+ }
+
property real downloadProgress: 0
property bool imageLoading: false
property bool editMode: false
@@ -99,7 +108,14 @@ ApplicationWindow {
ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false }
- Button { id: backButton; label: qsTr("Back"); rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 }
+ Button {
+ id: backButton
+ label: qsTr("Back")
+ rotation: 3
+ x: parent.width - backButton.width - 6
+ y: -backButton.height - 8
+ visible: Qt.platform.os !== "android"
+ }
Rectangle { id: photosShade; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 }