aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-11-04 14:56:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-05 12:20:39 +0100
commite17ae3b8b716b00c7cb6156347101f2e789dbd58 (patch)
tree931fcffe5321133bc4d5e6429a8c3c8beb809f71 /examples
parent2a1fc76f4ed1680e78b740c47fa736768aed82e9 (diff)
Replace Message attached property with gadget types
This is a more efficient way to expose the StandardButton and StandardIcon enums. Change-Id: I9d0becf54be2a883d55c9eaeaf10b83b23e59f3c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/dialogs/systemdialogs/MessageDialogs.qml42
1 files changed, 21 insertions, 21 deletions
diff --git a/examples/quick/dialogs/systemdialogs/MessageDialogs.qml b/examples/quick/dialogs/systemdialogs/MessageDialogs.qml
index e6fdf57e0d..9c70228046 100644
--- a/examples/quick/dialogs/systemdialogs/MessageDialogs.qml
+++ b/examples/quick/dialogs/systemdialogs/MessageDialogs.qml
@@ -61,12 +61,12 @@ Rectangle {
detailedText: customizeDetailedText.checked ? detailedTextField.text : ""
onButtonClicked: console.log("clicked button " + clickedButton)
onAccepted: lastChosen.text = "Accepted " +
- (clickedButton == Message.Ok ? "(OK)" : (clickedButton == Message.Retry ? "(Retry)" : "(Ignore)"))
+ (clickedButton == StandardButton.Ok ? "(OK)" : (clickedButton == StandardButton.Retry ? "(Retry)" : "(Ignore)"))
onRejected: lastChosen.text = "Rejected " +
- (clickedButton == Message.Close ? "(Close)" : (clickedButton == Message.Abort ? "(Abort)" : "(Cancel)"))
+ (clickedButton == StandardButton.Close ? "(Close)" : (clickedButton == StandardButton.Abort ? "(Abort)" : "(Cancel)"))
onHelp: lastChosen.text = "Yelped for help!"
- onYes: lastChosen.text = (clickedButton == Message.Yes ? "Yeessss!!" : "Yes, now and always")
- onNo: lastChosen.text = (clickedButton == Message.No ? "Oh No." : "No, no, a thousand times no!")
+ onYes: lastChosen.text = (clickedButton == StandardButton.Yes ? "Yeessss!!" : "Yes, now and always")
+ onNo: lastChosen.text = (clickedButton == StandardButton.No ? "Oh No." : "No, no, a thousand times no!")
onApply: lastChosen.text = "Apply"
onReset: lastChosen.text = "Reset"
}
@@ -105,7 +105,7 @@ Rectangle {
function updateIcon(icon, checked) {
if (updating) return
updating = true
- messageDialog.icon = (checked ? icon : Message.NoIcon)
+ messageDialog.icon = (checked ? icon : StandardIcon.NoIcon)
for (var i = 0; i < children.length; ++i)
if (children[i].icon !== icon)
children[i].checked = false
@@ -115,7 +115,7 @@ Rectangle {
CheckBox {
id: iconInformation
text: "Information"
- property int icon: Message.Information
+ property int icon: StandardIcon.Information
onCheckedChanged: parent.updateIcon(icon, checked)
}
@@ -123,7 +123,7 @@ Rectangle {
id: iconWarning
text: "Warning"
checked: true
- property int icon: Message.Warning
+ property int icon: StandardIcon.Warning
onCheckedChanged: parent.updateIcon(icon, checked)
Component.onCompleted: parent.updateIcon(icon, true)
}
@@ -131,14 +131,14 @@ Rectangle {
CheckBox {
id: iconCritical
text: "Critical"
- property int icon: Message.Critical
+ property int icon: StandardIcon.Critical
onCheckedChanged: parent.updateIcon(icon, checked)
}
CheckBox {
id: iconQuestion
text: "Question"
- property int icon: Message.Question
+ property int icon: StandardIcon.Question
onCheckedChanged: parent.updateIcon(icon, checked)
}
}
@@ -182,75 +182,75 @@ Rectangle {
if (children[i].checked)
buttons |= children[i].button
if (!buttons)
- buttons = Message.Ok
+ buttons = StandardButton.Ok
messageDialog.standardButtons = buttons
updating = false
}
CheckBox {
text: "Help"
- property int button: Message.Help
+ property int button: StandardButton.Help
onCheckedChanged: parent.updateButtons(button, checked)
}
CheckBox {
text: "Abort"
- property int button: Message.Abort
+ property int button: StandardButton.Abort
onCheckedChanged: parent.updateButtons(button, checked)
}
CheckBox {
text: "Close"
- property int button: Message.Close
+ property int button: StandardButton.Close
onCheckedChanged: parent.updateButtons(button, checked)
}
CheckBox {
text: "Cancel"
- property int button: Message.Cancel
+ property int button: StandardButton.Cancel
onCheckedChanged: parent.updateButtons(button, checked)
}
CheckBox {
text: "NoToAll"
- property int button: Message.NoToAll
+ property int button: StandardButton.NoToAll
onCheckedChanged: parent.updateButtons(button, checked)
}
CheckBox {
text: "No"
- property int button: Message.No
+ property int button: StandardButton.No
onCheckedChanged: parent.updateButtons(button, checked)
}
CheckBox {
text: "YesToAll"
- property int button: Message.YesToAll
+ property int button: StandardButton.YesToAll
onCheckedChanged: parent.updateButtons(button, checked)
}
CheckBox {
text: "Yes"
- property int button: Message.Yes
+ property int button: StandardButton.Yes
onCheckedChanged: parent.updateButtons(button, checked)
}
CheckBox {
text: "Ignore"
- property int button: Message.Ignore
+ property int button: StandardButton.Ignore
onCheckedChanged: parent.updateButtons(button, checked)
}
CheckBox {
text: "Retry"
- property int button: Message.Retry
+ property int button: StandardButton.Retry
onCheckedChanged: parent.updateButtons(button, checked)
}
CheckBox {
text: "OK"
checked: true
- property int button: Message.Ok
+ property int button: StandardButton.Ok
onCheckedChanged: parent.updateButtons(button, checked)
}
}