[SailfishDevel] datepickerdialog
Vesa-Matti Hartikainen
vesa-matti.hartikainen at jollamobile.com
Wed Feb 27 09:01:43 UTC 2013
Hi,
On 02/27/2013 10:34 AM, nicola at nicoladefilippo.it wrote:
> thus i changed it in (added ","):
>
> Button {
> id: button
> text: "choose a date"
>
> onClicked:
> pageStack.openDialog("Sailfish.Silica.DatePickerDialog", {
> year: 2012,
> month: 11,
> day: 23,
> /*onAccepted: {
> button.text = "You chose: " + dateText
> }*/
> })
> }
>
> but commenting onAccepted obviously is impossible to show selected date.
>
> Where is the error?
Thanks for reporting this. The docs are obviously having a bug.
This should work:
Button {
id: button
text: "choose a date"
onClicked: {
var dialog =
pageStack.openDialog("Sailfish.Silica.DatePickerDialog", {
year: 2012,
month: 11,
day: 23
});
dialog.accepted.connect(function() {
button.text = "you chose: " + dialog.dateText
})
}
}
BR,
Vesku
More information about the Devel
mailing list