![]() See also QDateEdit, QTimeEdit, QDate, and QTime. This allows the user to edit via an invalid date-time to reach a valid one. When keyboard tracking is disabled, changes are only signalled when focus leaves the text field after edits have modified the content. ![]() For example, for a range from to and an initial date of, the user can change neither the month (May 30th is outside the range) nor the day (April 2nd is outside the range). When the allowed range is narrower than some time interval whose end it straddles, keyboard tracking prevents the user editing the date or time to access the later part of the interval. When keyboard tracking is enabled (the default), every keystroke of editing a field triggers signals for value changes. The existing calendar widget can be retrieved with calendarWidget(). Additionally, you can supply a custom calendar widget for use as the calendar pop-up by calling the setCalendarWidget() function. This is enabled by setting the calendarPopup property. QDateTimeEdit can be configured to allow a QCalendarWidget to be used to select dates. By default, any date-time from the start of 100 CE to the end of 9999 CE is valid. The range of valid values for a QDateTimeEdit is controlled by the properties minimumDateTime, maximumDateTime, and their respective date and time components. Here we've created a new QDateTimeEdit object initialized with today's date, and restricted the valid date range to today plus or minus 365 days. addDays( 365)) ĭateEdit - >setDisplayFormat( "yyyy.MM.dd") addDays( - 365)) ĭateEdit - >setMaximumDate( QDate ::currentDate(). ![]() QDateTimeEdit *dateEdit = new QDateTimeEdit( QDate ::currentDate()) ĭateEdit - >setMinimumDate( QDate ::currentDate(). SetTimeRange(const QTime & min, const QTime & max) SetSelectedSection(QDateTimeEdit::Section section) SetDateTimeRange(const QDateTime & min, const QDateTime & max) SetDateRange(const QDate & min, const QDate & max) SetCurrentSection(QDateTimeEdit::Section section) SetCalendarWidget(QCalendarWidget * calendarWidget) SectionText(QDateTimeEdit::Section section) const QDateTimeEdit(QWidget * parent = nullptr) QDateTimeEdit(const QDateTime & datetime, QWidget * parent = nullptr) QDateTimeEdit(const QDate & date, QWidget * parent = nullptr) QDateTimeEdit(const QTime & time, QWidget * parent = nullptr) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |