QML UI: Dynamically change button text

Dynamically change the text of the show/hide profile button.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
This commit is contained in:
Grace Karanja 2015-08-12 20:18:34 +03:00 committed by Dirk Hohndel
parent 3d5ad19888
commit a734a2ee19

View file

@ -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"
}
}
}