Pages
API Documentation
On this page

FormDateTimeDelegate QML Type

FormDateTimeDelegate is a delegate for FormCard that lets the user enter either a date, a time or both. More...

Detailed Description

This component allows to define a minimumDate and maximumDate to restrict the date that the user is allowed to enter.

You should not add a label but instead use the above FormHeader to specify what the form delegate refers to.

import org.kde.kirigamiaddons.formcard as FormCard

FormCard.FormCardPage {
    FormCard.FormHeader {
        title: "Departure"
    }

    FormCard.FormCard {
        FormCard.FormDateTimeDelegate {}

        FormCard.FormDelegateSeparator {}

        FormCard.FormTextFieldDelegate {
            label: "Location"
        }
    }
}

Note: This component can also be used in a read only mode to display a date.

Warning: This will use the native date and time picker from the platform if available. For example this happens on Android.

Property Documentation

dateTimeDisplay : int

This property holds which part of the date and time selector are show to the user.

By default both the time and the date are shown.

Accepted values:

Constant Description
FormDateTimeDelegate.DateTimeDisplay.DateTime Show the date and time.
FormDateTimeDelegate.DateTimeDisplay.Date Show only the date.
FormDateTimeDelegate.DateTimeDisplay.Time Show only the time.

[default: ""] description : string

A label containing secondary text that appears under the inherited text property.

This provides additional information shown in a faint gray color.

initialValue : date

This property holds the the date to use as initial default when editing an an unset date.

By default, this is the current date/time.

maximumDate : date

This property holds the maximum date (inclusive) that the user can select.

By default, no limit is applied to the date selection.

minimumDate : date

This property holds the minimum date (inclusive) that the user can select.

By default, no limit is applied to the date selection.

[default: ApplicationWindow.window] popupParent : var

This property holds the parent used for the popups of this control.

[default: false] readOnly : bool

This property holds whether this delegate is readOnly or whether the user can select a new time and date.

[default: false] resettable : bool

This property holds whether the user can reset the date and time to an unset value.

When enabled, a "Reset" button is added to the date and time pickers. Clicking it sets value to an invalid date, which is displayed as "Not set".

status : var

This property holds the current status message type of the text field.

This consists of an inline message with a colorful background and an appropriate icon.

The status property will affect the color of statusMessage used.

Accepted values:

Constant Description
Kirigami.MessageType.Information (blue color)
Kirigami.MessageType.Positive (green color)
Kirigami.MessageType.Warning (orange color)
Kirigami.MessageType.Error (red color)

Default: Kirigami.MessageType.Information if statusMessage is set, nothing otherwise.

See also Kirigami.MessageType

statusMessage : string

This property holds the current status message of the text field.

If this property is not set, no status will be shown.

value : date

The current date and time selected by the user.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.