summaryrefslogtreecommitdiff
path: root/src/controls/Button.qml
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-06-03 14:05:26 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-03 22:25:54 +0200
commiteeb3c959334d1e6b4ea9f7538b603a711f8a8262 (patch)
treea8e8336d2cc1de41e64ddfdfa4092b5afe329000 /src/controls/Button.qml
parent4e5bf941f1b3089c22392bb5416d44cb8defe47d (diff)
downloadqtquickcontrols-eeb3c959334d1e6b4ea9f7538b603a711f8a8262.tar.gz
Buttons: Allow overriding of visual properties when 'action' is set
Those properties are, text, tooltip, iconName, and iconSource. Also, properly capitalized gallery's tooltips. Change-Id: I1995a85565edd7aaa420279821d7c1a31ef18253 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/controls/Button.qml')
-rw-r--r--src/controls/Button.qml22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/controls/Button.qml b/src/controls/Button.qml
index 21231e57..1f00dccb 100644
--- a/src/controls/Button.qml
+++ b/src/controls/Button.qml
@@ -72,20 +72,6 @@ BasicButton {
*/
property bool isDefault: false
- /*! This property holds the text shown on the button. If the button has no
- text, the \l text property will be an empty string.
-
- The default value is the empty string.
- */
- property string text
-
- /*! This property holds the icon shown on the button. If the button has no
- icon, the iconSource property will be an empty string.
-
- The default value is the empty string.
- */
- property url iconSource
-
/*! Assign a \l Menu to this property to get a pull-down menu button.
The default value is \c null.
@@ -115,6 +101,14 @@ BasicButton {
value: button
}
+ Binding {
+ target: button
+ property: "tooltip"
+ // We don't want a tooltip if it's the same as the button text
+ when: !!text && !(action && (!!action.tooltip || action.tooltip === text))
+ value: ""
+ }
+
Connections {
target: __behavior
onEffectivePressedChanged: {