Calendar QML Type▲
-
Import Statement: import QtQuick.Controls 1.4
-
Since: Qt 5.3
-
Inherits: FocusScope
-
Group: Calendar is part of Buttons and Controls
Detailed Description▲
Calendar allows selection of dates from a grid of days, similar to QCalendarWidget.
The dates on the calendar can be selected with the mouse, or navigated with the keyboard.
The selected date can be set through selectedDate. A minimum and maximum date can be set through minimumDate and maximumDate. The earliest minimum date that can be set is 1 January, 1 AD. The latest maximum date that can be set is 25 October, 275759 AD.
Calendar {
minimumDate
:
new
Date(2017
, 0
, 1
)
maximumDate
:
new
Date(2018
, 0
, 1
)
}
The selected date is displayed using the format in the application's default locale.
Week numbers can be displayed by setting the weekNumbersVisible property to true.
Calendar
{
weekNumbersVisible
:
true
}
You can create a custom appearance for Calendar by assigning a CalendarStyle.
Property Documentation▲
dayOfWeekFormat : int▲
The format in which the days of the week (in the header) are displayed.
Locale.ShortFormat is the default and recommended format, as Locale.NarrowFormat may not be fully supported by each locale (see Locale String Format Types) and Locale.LongFormat may not fit within the header cells.
frameVisible : bool▲
This property determines the visibility of the frame surrounding the calendar.
The default value is true.
[since QtQuick.Controls 1.6] locale : var▲
This property controls the locale that this calendar uses to display itself.
The locale affects how dates and day names are localized, as well as which day is considered the first in a week.
The following example sets an Australian locale:
locale
:
Qt.locale("en_AU"
)
The default value is equivalent to Qt.locale().
This property was introduced in QtQuick.Controls 1.6.
maximumDate : date▲
The latest date that this calendar will accept.
By default, this property is set to the latest maximum date (25 October, 275759 AD).
minimumDate : date▲
The earliest date that