IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Calendar QML Type

Provides a way to select dates from a calendar.

This type was introduced in Qt 5.3.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Calendar QML Type▲

  • Import Statement: import QtQuick.Controls 1.4

  • Since: Qt 5.3

  • Inherits: FocusScope

  • Group: Calendar is part of https://

Detailed Description▲

Image non disponible

Calendar allows selection of dates from a grid of days, similar to https://.

The dates on the calendar can be selected with the mouse, or navigated with the keyboard.

The selected date can be set through https://. A minimum and maximum date can be set through https:// and https://. 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.

 
Sélectionnez
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 https:// property to true.

 
Sélectionnez
Calendar {
    weekNumbersVisible: true
}

You can create a custom appearance for Calendar by assigning a https://.

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 https://) 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:

 
Sélectionnez
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 this calendar will accept.

By default, this property is set to the earliest minimum date (1 January, 1 AD).

[since QtQuick.Controls 1.3] navigationBarVisible : bool▲

The default value is true.

This property was introduced in QtQuick.Controls 1.3.

selectedDate : date▲

The date that has been selected by the user.

This property is subject to the following validation:

  • If selectedDate is outside the range of https:// and https://, it will be clamped to be within that range.

  • selectedDate will not be changed if undefined or some other invalid value is assigned.

  • If there are hours, minutes, seconds or milliseconds set, they will be removed.

The default value is the current date, which is equivalent to:

 
Sélectionnez
new Date()

style : Component▲

The style Component for this control.

See Also▲

See also Qt Quick Controls Styles QML Types

visibleMonth : int▲

This property determines which month in https:// is shown on the calendar.

The month is from 0 to 11 to be consistent with the JavaScript Date object.

See Also▲

See also https://

visibleYear : int▲

This property determines which year is shown on the calendar.

See Also▲

See also https://

weekNumbersVisible : bool▲

This property determines the visibility of week numbers.

The default value is false.

Signal Documentation▲

 

clicked(date date)▲

Emitted when the mouse is clicked on a valid date in the calendar.

date is the date that the mouse was clicked on.

The corresponding handler is onClicked.

The corresponding handler is onClicked.

doubleClicked(date date)▲

Emitted when the mouse is double-clicked on a valid date in the calendar.

date is the date that the mouse was double-clicked on.

The corresponding handler is onDoubleClicked.

The corresponding handler is onDoubleClicked.

hovered(date date)▲

Emitted when the mouse hovers over a valid date in the calendar.

date is the date that was hovered over.

The corresponding handler is onHovered.

The corresponding handler is onHovered.

[since QtQuick.Controls 1.3] pressAndHold(date date)▲

Emitted when the mouse is pressed and held on a valid date in the calendar.

date is the date that the mouse was pressed on.

The corresponding handler is onPressAndHold.

The corresponding handler is onPressAndHold.

This signal was introduced in QtQuick.Controls 1.3.

pressed(date date)▲

Emitted when the mouse is pressed on a valid date in the calendar.

This is also emitted when dragging the mouse to another date while it is pressed.

date is the date that the mouse was pressed on.

The corresponding handler is onPressed.

The corresponding handler is onPressed.

released(date date)▲

Emitted when the mouse is released over a valid date in the calendar.

date is the date that the mouse was released over.

The corresponding handler is onReleased.

The corresponding handler is onReleased.

Method Documentation▲

 

void showNextMonth()▲

Sets https:// to the next month.

void showNextYear()▲

Sets https:// to the next year.

void showPreviousMonth()▲

Sets https:// to the previous month.

void showPreviousYear()▲

Sets https:// to the previous year.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.