Qt Reference Documentation

QML DatePickerDialog Element

Shows the date picker dialog. More...

Inherits CommonDialog

This element was introduced in Qt Quick Components 1.0.

Properties

Detailed Description

Showing a Date Picker Dialog

The code snippet below illustrates how to create a DatePickerDialog.

 DatePickerDialog {
     id: tDialog
     titleText: "Date of birth"
     onAccepted: callbackFunction()
 }

 function launchDialog() {
     tDialog.open();
 }

 function launchDialogToToday() {
     var d = new Date();
     tDialog.year = d.getFullYear();
     tDialog.month = d.getMonth();
     tDialog.day = d.getDate();
     tDialog.open();
 }

 function callbackFunction() {
     result.text = tDialog.year + " " + tDialog.month + " " + tDialog.day
 }

See also Dialog.

Property Documentation

acceptButtonText : string

The button text for the accept button. The value is optional.


day : int

The displayed day. The default value is 1.


maximumYear : int

The maximum year shown on the tumbler. You should set this property only once during the construction. If you modify it afterwards everything is uninitialized. The default value is current year + 20. The value is optional.


minimumYear : int

The minimum year shown on the tumbler. You should set this property only once during the construction. If you modify it afterwards everything is uninitialized. The default value is current year. The value is optional.


month : int

The displayed month. The default value is 1.


rejectButtonText : string

The button text for the reject button. The value is optional.


titleText : string

The title text for the dialog if the value is not null. If further customization is needed, use the title property instead.


year : int

The displayed year. The default value is 0.