From a734a2ee19cd865e70e8d4380ff7cae5b94b4342 Mon Sep 17 00:00:00 2001 From: Grace Karanja Date: Wed, 12 Aug 2015 20:18:34 +0300 Subject: [PATCH] QML UI: Dynamically change button text Dynamically change the text of the show/hide profile button. Signed-off-by: Grace Karanja --- qt-mobile/DiveDetails.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qt-mobile/DiveDetails.qml b/qt-mobile/DiveDetails.qml index d6a562630..21127f470 100644 --- a/qt-mobile/DiveDetails.qml +++ b/qt-mobile/DiveDetails.qml @@ -92,9 +92,14 @@ Item { } } Button { - text: "Show/Hide Dive Profile" + text: "Hide Dive Profile" onClicked: { qmlProfile.visible = !qmlProfile.visible + if (qmlProfile.visible) { + text = "Hide Dive Profile" + } else { + text = "Show Dive Profile" + } } }