4#include <private/qapplication_p.h>
5#include <private/qdatetimeedit_p.h>
12#include <private/qlineedit_p.h>
23#ifdef QDATETIMEEDIT_QDTEDEBUG
24# define QDTEDEBUG qDebug() << QString::fromLatin1("%1:%2").arg(__FILE__).arg(__LINE__)
25# define QDTEDEBUGN qDebug
27# define QDTEDEBUG if (false) qDebug()
28# define QDTEDEBUGN if (false) qDebug
195 d->parserType = parserType;
228 return d->value.toDateTime();
235 QDateTime when =
d->convertTimeZone(datetime);
261 return d->value.toDate();
294 return d->value.toTime();
317 QDateTime previousValue =
d->value.toDateTime();
347 return d->minimum.toDateTime();
360 const QDateTime max =
d->maximum.toDateTime();
361 d->setRange(
m, (max >
m ? max :
m));
389 return d->maximum.toDateTime();
402 const QDateTime min =
d->minimum.toDateTime();
403 d->setRange((min <
m ? min :
m),
m);
435 const QDateTime minimum = min.toTimeZone(
d->timeZone);
437 d->setRange(minimum, maximum);
465 return d->minimum.toDate();
505 return d->maximum.toDate();
543 return d->minimum.toTime();
580 return d->maximum.toTime();
624 if (min.isValid() && max.
isValid()) {
626 d->dateTimeValue(max,
d->maximum.toTime()));
663 if (min.isValid() && max.
isValid()) {
665 d->dateTimeValue(
d->maximum.toDate(), max));
694#ifdef QT_KEYPAD_NAVIGATION
695 if (QApplicationPrivate::keypadNavigationEnabled() &&
d->focusOnButton)
704 if (section ==
NoSection || !(section &
d->sections))
707 d->updateCache(
d->value,
d->displayText());
708 const int size =
d->sectionNodes.size();
709 int index =
d->currentSectionIndex + 1;
710 for (
int i=0;
i<2; ++
i) {
713 d->edit->setCursorPosition(
d->sectionPos(
index));
736 if (index < 0 || index >=
d->sectionNodes.size())
753 return d->sectionNodes.size();
774 return d->currentSectionIndex;
780 if (index < 0 || index >=
d->sectionNodes.size())
782 d->edit->setCursorPosition(
d->sectionPos(
index));
800 if (!
d->monthCalendar) {
803 return d->monthCalendar->calendarWidget();
819 qWarning(
"QDateTimeEdit::setCalendarWidget: Cannot set a null calendar widget");
824 qWarning(
"QDateTimeEdit::setCalendarWidget: calendarPopup is set to false");
829 qWarning(
"QDateTimeEdit::setCalendarWidget: no date sections specified");
852 d->edit->setSelection(
d->edit->cursorPosition(), 0);
853 }
else if (section &
d->sections) {
856 d->setSelected(
d->currentSectionIndex);
877 d->updateCache(
d->value,
d->displayText());
878 const int sectionIndex =
d->absoluteIndex(section, 0);
879 return d->sectionText(sectionIndex);
917 d->unreversedFormat.clear();
920 d->displayFormat.clear();
921 for (
int i=
d->sectionNodes.size() - 1;
i>=0; --
i) {
922 d->displayFormat +=
d->separators.at(
i + 1);
923 d->displayFormat +=
d->sectionNode(
i).format();
925 d->displayFormat +=
d->separators.at(0);
926 std::reverse(
d->separators.begin(),
d->separators.end());
927 std::reverse(
d->sectionNodes.begin(),
d->sectionNodes.end());
930 d->formatExplicitlySet =
true;
934 d->currentSectionIndex =
qMin(
d->currentSectionIndex,
d->sectionNodes.size() - 1);
938 if (timeShown && !dateShown) {
941 if (
d->minimum.toTime() >=
d->maximum.toTime()) {
946 }
else if (dateShown && !timeShown) {
948 d->value =
d->value.toDate().startOfDay(
d->timeZone);
951 d->_q_editorCursorPositionChanged(-1, 0);
969 return d->calendarPopup;
975 if (
enable ==
d->calendarPopup)
979#ifdef QT_KEYPAD_NAVIGATION
981 d->focusOnButton =
false;
983 d->updateEditFieldGeometry();
996 return d->timeZone.timeSpec();
1002 if (spec !=
d->timeZone.timeSpec()) {
1011 qWarning() <<
"Ignoring attempt to set time-spec" << spec
1012 <<
"which is not yet supported by QDateTimeEdit";
1016 d->updateTimeZone();
1027 if (
d->cachedSizeHint.isEmpty()) {
1031 int h =
d->edit->sizeHint().height();
1034 s =
d->textFromValue(
d->minimum) + u
' ';
1036 s =
d->textFromValue(
d->maximum) + u
' ';
1038 if (
d->specialValueText.size()) {
1039 s =
d->specialValueText;
1047 if (
d->calendarPopupEnabled()) {
1053 QStyleOptionSpinBox
opt;
1058 d->cachedMinimumSizeHint =
d->cachedSizeHint;
1061 return d->cachedSizeHint;
1072 switch (
event->type()) {
1074 const bool was =
d->formatExplicitlySet;
1075 const QString oldFormat =
d->displayFormat;
1076 d->displayFormat.clear();
1078 d->formatExplicitlySet = was;
1102 d->clearSection(
d->currentSectionIndex);
1111 int oldCurrent =
d->currentSectionIndex;
1113 bool inserted =
false;
1115 switch (
event->key()) {
1116#ifdef QT_KEYPAD_NAVIGATION
1118 if (QApplicationPrivate::keypadNavigationEnabled() &&
d->calendarPopupEnabled()) {
1119 d->initCalendarPopup();
1120 d->positionCalendarPopup();
1121 d->monthCalendar->show();
1126 if (QApplicationPrivate::keypadNavigationEnabled()) {
1127 if (hasEditFocus()) {
1128 if (
d->focusOnButton) {
1129 d->initCalendarPopup();
1130 d->positionCalendarPopup();
1131 d->monthCalendar->show();
1132 d->focusOnButton =
false;
1135 setEditFocus(
false);
1141 d->edit->d_func()->setCursorVisible(
false);
1142 d->edit->d_func()->control->setBlinkingCursorEnabled(
false);
1151 d->setSelected(
d->currentSectionIndex,
true);
1154 emit d->edit->returnPressed();
1157#ifdef QT_KEYPAD_NAVIGATION
1158 if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()
1159 && !
event->text().isEmpty() &&
event->text().at(0).isLetterOrNumber()) {
1163 d->edit->d_func()->setCursorVisible(
false);
1164 d->edit->d_func()->control->setBlinkingCursorEnabled(
false);
1169 if (!
d->isSeparatorKey(
event)) {
1170 inserted =
select = !
event->text().isEmpty() &&
event->text().at(0).isPrint()
1179#ifdef QT_KEYPAD_NAVIGATION
1180 QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()
1181 || !QApplicationPrivate::keypadNavigationEnabled() &&
1192 if (
d->specialValue()) {
1193 d->edit->setSelection(
d->edit->cursorPosition(), 0);
1198#ifdef QT_KEYPAD_NAVIGATION
1199 int newSection =
d->nextPrevSection(
d->currentSectionIndex, forward);
1200 if (QApplicationPrivate::keypadNavigationEnabled()) {
1201 if (
d->focusOnButton) {
1202 newSection = forward ? 0 :
d->sectionNodes.size() - 1;
1203 d->focusOnButton =
false;
1205 }
else if (newSection < 0 && select && d->calendarPopupEnabled()) {
1207 d->focusOnButton =
true;
1223 if (
select && !
d->edit->hasSelectedText()) {
1226 int pos =
d->edit->cursorPosition();
1228 && (
d->sectionNodes.at(oldCurrent).count != 1
1229 ||
d->sectionMaxSize(oldCurrent) ==
d->sectionSize(oldCurrent)
1230 ||
d->skipToNextSection(oldCurrent,
d->value.toDateTime(),
d->sectionText(oldCurrent)))) {
1231 QDTEDEBUG <<
"Setting currentsection to"
1232 <<
d->closestSection(
d->edit->cursorPosition(),
true) <<
event->key()
1233 << oldCurrent <<
str;
1234 const int tmp =
d->closestSection(
d->edit->cursorPosition(),
true);
1236 d->currentSectionIndex = tmp;
1239 if (
d->currentSectionIndex != oldCurrent) {
1240 d->setSelected(
d->currentSectionIndex);
1243 if (
d->specialValue()) {
1244 d->edit->setSelection(
d->edit->cursorPosition(), 0);
1252#if QT_CONFIG(wheelevent)
1253void QDateTimeEdit::wheelEvent(QWheelEvent *
event)
1255 QAbstractSpinBox::wheelEvent(
event);
1267 const int oldPos =
d->edit->cursorPosition();
1268 if (!
d->formatExplicitlySet) {
1270 if (
d->displayFormat ==
d->defaultTimeFormat) {
1271 frm = &
d->defaultTimeFormat;
1272 }
else if (
d->displayFormat ==
d->defaultDateFormat) {
1273 frm = &
d->defaultDateFormat;
1274 }
else if (
d->displayFormat ==
d->defaultDateTimeFormat) {
1275 frm = &
d->defaultDateTimeFormat;
1279 d->readLocaleSettings();
1280 if (
d->displayFormat != *frm) {
1282 d->formatExplicitlySet =
false;
1283 d->edit->setCursorPosition(oldPos);
1287 const bool oldHasHadFocus =
d->hasHadFocus;
1288 d->hasHadFocus =
true;
1290 switch (
event->reason()) {
1309 d->setSelected(
first ? 0 :
d->sectionNodes.size() - 1);
1319 const int newSection =
d->nextPrevSection(
d->currentSectionIndex,
next);
1320 switch (
d->sectionType(newSection)) {
1326 d->edit->deselect();
1327 d->edit->setCursorPosition(
d->sectionPos(newSection));
1329 d->setSelected(newSection,
true);
1341#ifdef QT_KEYPAD_NAVIGATION
1343 if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
1349 int blocks = minutes/15;
1358 minutes = blocks * 15;
1362 int max_minutes =
d->maximum.toTime().hour()*60 +
d->maximum.toTime().minute();
1363 int min_minutes =
d->minimum.toTime().hour()*60 +
d->minimum.toTime().minute();
1365 if (minutes >= max_minutes) {
1368 }
else if (minutes <= min_minutes) {
1381 for (
int i=0;
i<
d->sectionNodes.size(); ++
i) {
1383 d->currentSectionIndex =
i;
1388 d->setValue(
d->stepBy(
d->currentSectionIndex, steps,
false),
EmitIfChanged);
1389 d->updateCache(
d->value,
d->displayText());
1391 d->setSelected(
d->currentSectionIndex);
1392 d->updateTimeZone();
1422 int pos =
d->edit->cursorPosition();
1450 int copy =
d->edit->cursorPosition();
1460 value.timeRepresentation());
1475 if (
d->specialValue()) {
1476 return (
d->minimum ==
d->maximum ? StepEnabled{} : StepEnabled(
StepUpEnabled));
1479 QAbstractSpinBox::StepEnabled
ret = { };
1481#ifdef QT_KEYPAD_NAVIGATION
1482 if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
1490 max =
d->maximum.toTime();
1491 min =
d->minimum.toTime();
1492 val =
d->value.toTime();
1495 max =
d->maximum.toDate();
1496 min =
d->minimum.toDate();
1497 val =
d->value.toDate();
1511 switch (
d->sectionType(
d->currentSectionIndex)) {
1520 QVariant v =
d->stepBy(
d->currentSectionIndex, 1,
true);
1521 if (
v !=
d->value) {
1524 v =
d->stepBy(
d->currentSectionIndex, -1,
true);
1525 if (
v !=
d->value) {
1540 if (!
d->calendarPopupEnabled()) {
1544 d->updateHoverControl(
event->position().toPoint());
1551 d->initCalendarPopup();
1552 d->positionCalendarPopup();
1554 d->monthCalendar->show();
1714 type = QMetaType::QDateTime;
1764#ifdef QT_KEYPAD_NAVIGATION
1765 && !(QApplicationPrivate::keypadNavigationEnabled() && !
edit->hasEditFocus())
1814#ifdef QT_KEYPAD_NAVIGATION
1815 || (QApplicationPrivate::keypadNavigationEnabled() && !
edit->hasEditFocus())
1858 return (
pos < tmp ? -1 :
i);
1885 if (
pos < tmp && !forward) {
1893 qWarning(
"QDateTimeEdit: Internal Error: closestSection returned NoSection");
1906 if (
q->isRightToLeft())
1917 current += (forward ? 1 : -1);
1920 }
else if (current < 0) {
1935 const auto space = u
' ';
1941 qWarning(
"QDateTimeEdit: Internal error (%s:%d)", __FILE__, __LINE__);
1979 if (
input.isEmpty()) {
1990 bool changeCase =
false;
1993 for (
i=0;
i<max; ++
i) {
2050 return q->textFromDateTime(
f.toDateTime());
2063 return q->dateTimeFromText(
f).toTimeZone(
timeZone);
2087 v =
q->dateTimeFromText(
str);
2096#ifndef QT_ALWAYS_WRAP_WEEKDAY
2124 const int span = max - min + 1;
2131 const int oldDay =
v.date().day(
calendar);
2139 auto msecsSinceEpoch =
v.toMSecsSinceEpoch();
2142 msecsSinceEpoch -= 3600 * 1000;
2152 && (v < minimumDateTime || v > maximumDateTime)) {
2153 const int localmin =
getDigit(minimumDateTime, sectionIndex);
2154 const int localmax =
getDigit(maximumDateTime, sectionIndex);
2162 const int daysInMonth =
v.date().daysInMonth(
calendar);
2164 const int adds =
qMin(oldDay, daysInMonth);
2169 if (
v < minimumDateTime) {
2171 if (
v < minimumDateTime)
2172 setDigit(
v, sectionIndex, localmin + 1);
2177 const int daysInMonth =
v.date().daysInMonth(
calendar);
2179 const int adds =
qMin(oldDay, daysInMonth);
2184 if (
v > maximumDateTime) {
2186 if (
v > maximumDateTime)
2187 setDigit(
v, sectionIndex, localmax - 1);
2191 setDigit(
v, sectionIndex, (steps > 0 ? localmax : localmin));
2199 if (
v < minimumDateTime) {
2202 setDigit(
t, sectionIndex, steps < 0 ? max : min);
2203 bool mincmp = (
t >= minimumDateTime);
2204 bool maxcmp = (
t <= maximumDateTime);
2205 if (!mincmp || !maxcmp) {
2208 : minimumDateTime, sectionIndex));
2209 mincmp = (
t >= minimumDateTime);
2210 maxcmp = (
t <= maximumDateTime);
2212 if (mincmp && maxcmp) {
2218 }
else if (
v > maximumDateTime) {
2221 setDigit(
t, sectionIndex, steps > 0 ? min : max);
2222 bool mincmp = (
t >= minimumDateTime);
2223 bool maxcmp = (
t <= maximumDateTime);
2224 if (!mincmp || !maxcmp) {
2227 maximumDateTime, sectionIndex));
2228 mincmp = (
t >= minimumDateTime);
2229 maxcmp = (
t <= maximumDateTime);
2231 if (mincmp && maxcmp) {
2262 if (datechanged || timechanged)
2264 if (dodate && datechanged)
2266 if (dotime && timechanged)
2283 const bool forward = oldpos <= newpos;
2293 const int selSection =
sectionAt(selstart);
2294 const int l = selSection != -1 ?
sectionSize(selSection) : 0;
2320 if (oldpos < newpos) {
2333 "QDateTimeEditPrivate::_q_editorCursorPositionChanged()",
2378 QDateTimeEdit::Sections
ret;
2406 if (!
d->calendarPopupEnabled()) {
2411 QStyleOptionSpinBox
opt;
2483 if (
d->calendarPopupEnabled()) {
2497 case QMetaType::QDate:
2502 q->setDisplayFormat(
"dd/MM/yyyy"_L1);
2504 case QMetaType::QDateTime:
2509 q->setDisplayFormat(
"dd/MM/yyyy hh:mm:ss"_L1);
2511 case QMetaType::QTime:
2516 q->setDisplayFormat(
"hh:mm:ss"_L1);
2519 Q_ASSERT_X(0,
"QDateTimeEditPrivate::init",
"Internal error");
2522#ifdef QT_KEYPAD_NAVIGATION
2523 if (QApplicationPrivate::keypadNavigationEnabled())
2524 q->setCalendarPopup(
true);
2638 pos2 =
q->mapToGlobal(pos2);
2648 if (
pos.x() < screenRect.
left())
2658 pos.setY(pos2.
y() -
size.height());
2659 else if (
pos.y() < screenRect.
top())
2660 pos.setY(screenRect.
top());
2661 if (
pos.y() < screenRect.
top())
2662 pos.setY(screenRect.
top());
2688 dateChanged =
false;
2690 verifyCalendarInstance();
2700 cw->setCalendar(calendarSystem);
2702#ifdef QT_KEYPAD_NAVIGATION
2703 if (QApplicationPrivate::keypadNavigationEnabled())
2709 return calendar.
data();
2717 if (!widgetLayout) {
2722 delete calendar.
data();
2743 cw->setMinimumDate(min);
2744 cw->setMaximumDate(max);
2769#if QT_CONFIG(shortcut)
2773 dateChanged =
false;
2779void QCalendarPopup::dateSelectionChanged()
2784void QCalendarPopup::dateSelected(
QDate date)
2799#include "moc_qdatetimeedit.cpp"
2800#include "moc_qdatetimeedit_p.cpp"
virtual QStyle::SubControl newHoverControl(const QPoint &pos)
virtual void setRange(const QVariant &min, const QVariant &max)
bool specialValue() const
uint ignoreCursorPositionChanged
virtual void interpret(EmitPolicy ep)
QStyle::SubControl hoverControl
virtual void updateEditFieldGeometry()
virtual QVariant bound(const QVariant &val, const QVariant &old=QVariant(), int steps=0) const
virtual void clearCache() const
QValidator::State cachedState
void setValue(const QVariant &val, EmitPolicy ep, bool updateEdit=true)
QAbstractSpinBox::CorrectionMode correctionMode
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
void selectAll()
Selects all the text in the spinbox except the prefix and suffix.
void editingFinished()
This signal is emitted editing is finished.
void focusInEvent(QFocusEvent *event) override
\reimp
QString text
the spin box's text, including any prefix and suffix
void paintEvent(QPaintEvent *event) override
\reimp
void mousePressEvent(QMouseEvent *event) override
\reimp
virtual void initStyleOption(QStyleOptionSpinBox *option) const
Initialize option with the values from this QSpinBox.
bool event(QEvent *event) override
\reimp
void keyPressEvent(QKeyEvent *event) override
\reimp
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment.
void setSpacing(int spacing) override
Reimplements QLayout::setSpacing().
The QCalendar class describes calendar systems.
constexpr bool isLetterOrNumber() const noexcept
Returns true if the character is a letter or number (Letter_* or Number_* categories); otherwise retu...
QChar toLower() const noexcept
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
constexpr bool isNumber() const noexcept
Returns true if the character is a number (Number_* categories, not just 0-9); otherwise returns fals...
QDateEdit(QWidget *parent=nullptr)
Constructs an empty date editor with a parent.
void userDateChanged(QDate date)
This signal only exists to fully implement the date Q_PROPERTY on the class.
QDateTime getMaximum() const override
bool calendarPopupEnabled() const
void clearSection(int index)
int closestSection(int index, bool forward) const
QVariant valueFromText(const QString &f) const override
QString defaultDateTimeFormat
void emitSignals(EmitPolicy ep, const QVariant &old) override
QString textFromValue(const QVariant &f) const override
QDateTime stepBy(int index, int steps, bool test=false) const
QDateTimeEditPrivate(const QTimeZone &zone=QTimeZone::LocalTime)
int sectionAt(int pos) const
void clearCache() const override
bool isSeparatorKey(const QKeyEvent *k) const
void updateEditFieldGeometry() override
QCalendarPopup * monthCalendar
QLocale locale() const override
QString defaultDateFormat
QDateTime convertTimeZone(const QDateTime &datetime)
void setSelected(int index, bool forward=false)
void updateEdit() override
static QDateTimeEdit::Sections convertSections(QDateTimeParser::Sections s)
static QDateTimeEdit::Section convertToPublic(QDateTimeParser::Section s)
QDateTime getMinimum() const override
void setRange(const QVariant &min, const QVariant &max) override
QStyle::SubControl newHoverControl(const QPoint &pos) override
QDateTime validateAndInterpret(QString &input, int &, QValidator::State &state, bool fixup=false) const
void updateCache(const QVariant &val, const QString &str) const
void initCalendarPopup(QCalendarWidget *cw=nullptr)
QDateTime dateTimeValue(QDate date, QTime time) const
QDateTimeEdit::Sections sections
void positionCalendarPopup()
int absoluteIndex(QDateTimeEdit::Section s, int index) const
void syncCalendarWidget()
QStyle::StateFlag arrowState
QVariant getZeroVariant() const override
int nextPrevSection(int index, bool forward) const
void _q_editorCursorPositionChanged(int oldpos, int newpos) override
void readLocaleSettings()
void interpret(EmitPolicy ep) override
QString defaultTimeFormat
void updateArrow(QStyle::StateFlag state)
QString displayText() const override
The QDateTimeEdit class provides a widget for editing dates and times.
void setCurrentSectionIndex(int index)
void clearMaximumDateTime()
void setTimeRange(QTime min, QTime max)
Set the range of allowed times for the date time edit.
void setMinimumDate(QDate min)
QTime maximumTime
The maximum time of the date time edit.
void setDateTimeRange(const QDateTime &min, const QDateTime &max)
Set the range of allowed date-times for the date time edit.
void setMaximumTime(QTime max)
QString displayFormat
The format used to display the time/date of the date time edit.
int sectionCount
The number of sections displayed. If the format is 'yyyy/yy/yyyy', sectionCount returns 3.
void keyPressEvent(QKeyEvent *event) override
\reimp
Sections displayedSections
The currently displayed fields of the date time edit.
bool event(QEvent *event) override
\reimp
bool focusNextPrevChild(bool next) override
\reimp
QValidator::State validate(QString &input, int &pos) const override
\reimp
QCalendar calendar() const
QCalendarWidget * calendarWidget() const
Returns the calendar widget for the editor if calendarPopup is set to true and (sections() & DateSect...
void focusInEvent(QFocusEvent *event) override
\reimp
QDateTime maximumDateTime
The maximum datetime of the date time edit.
QTime minimumTime
The minimum time of the date time edit.
void setCalendarPopup(bool enable)
void setTimeSpec(Qt::TimeSpec spec)
void setMaximumDate(QDate max)
void clear() override
\reimp
void setDateRange(QDate min, QDate max)
Set the range of allowed dates for the date time edit.
void setDisplayFormat(const QString &format)
void setSelectedSection(Section section)
virtual QString textFromDateTime(const QDateTime &dt) const
This virtual function is used by the date time edit whenever it needs to display dateTime.
void mousePressEvent(QMouseEvent *event) override
\reimp
virtual QDateTime dateTimeFromText(const QString &text) const
Returns an appropriate datetime for the given text.
void initStyleOption(QStyleOptionSpinBox *option) const override
Initialize option with the values from this QDataTimeEdit.
void setCurrentSection(Section section)
Qt::TimeSpec timeSpec
The current timespec used by the date time edit.
int currentSectionIndex
The current section index of the spinbox.
QString sectionText(Section section) const
Returns the text from the given section.
QDateTime minimumDateTime
The minimum datetime of the date time edit.
Section
\value NoSection \value AmPmSection \value MSecSection \value SecondSection \value MinuteSection \val...
Section currentSection
The current section of the spinbox.
void dateChanged(QDate date)
This signal is emitted whenever the date is changed.
void setCalendar(QCalendar calendar)
QDateTimeEdit(QWidget *parent=nullptr)
Constructs an empty date time editor with a parent.
QTime time
The QTime that is set in the widget.
void setMinimumDateTime(const QDateTime &dt)
bool calendarPopup
The current calendar pop-up show mode.
void setDateTime(const QDateTime &dateTime)
void setMaximumDateTime(const QDateTime &dt)
void setMinimumTime(QTime min)
StepEnabled stepEnabled() const override
\reimp
~QDateTimeEdit()
Destructor.
Section sectionAt(int index) const
void setCalendarWidget(QCalendarWidget *calendarWidget)
void fixup(QString &input) const override
\reimp
void paintEvent(QPaintEvent *event) override
\reimp
QDate minimumDate
The minimum date of the date time edit.
void clearMinimumDateTime()
void timeChanged(QTime time)
This signal is emitted whenever the time is changed.
void stepBy(int steps) override
\reimp
QDateTime dateTime
The QDateTime that is set in the QDateTimeEdit.
QDate maximumDate
The maximum date of the date time edit.
QDate date
The QDate that is set in the widget.
QSize sizeHint() const override
\reimp
int absoluteMin(int index) const
int sectionSize(int index) const
int absoluteMax(int index, const QDateTime &value=QDateTime()) const
FieldInfo fieldInfo(int index) const
virtual QDateTime getMaximum() const
int getDigit(const QDateTime &dt, int index) const
StateNode parse(const QString &input, int position, const QDateTime &defaultValue, bool fixup) const
virtual QDateTime getMinimum() const
QList< SectionNode > sectionNodes
const SectionNode & sectionNode(int index) const
bool setDigit(QDateTime &t, int index, int newval) const
int sectionPos(int index) const
\inmodule QtCore\reentrant
qint64 toMSecsSinceEpoch() const
static QDateTime fromMSecsSinceEpoch(qint64 msecs, const QTimeZone &timeZone)
bool isNull() const
Returns true if both the date and the time are null; otherwise returns false.
QDateTime toTimeZone(const QTimeZone &toZone) const
bool isValid() const
Returns true if this datetime represents a definite moment, otherwise false.
QTimeZone timeRepresentation() const
QDate date() const
Returns the date part of the datetime.
\inmodule QtCore \reentrant
constexpr bool isValid() const
Returns true if this date is valid; otherwise returns false.
QDateTime endOfDay(const QTimeZone &zone) const
QDateTime startOfDay(const QTimeZone &zone) const
@ ApplicationLayoutDirectionChange
The QFocusEvent class contains event parameters for widget focus events.
\reentrant \inmodule QtGui
int horizontalAdvance(const QString &, int len=-1) const
Returns the horizontal advance in pixels of the first len characters of text.
QScreen * primaryScreen
the primary (or default) screen of the application.
static QScreen * screenAt(const QPoint &point)
Returns the screen at point, or \nullptr if outside of any screen.
The QHideEvent class provides an event which is sent after a widget is hidden.
The QKeyEvent class describes a key event.
QString text() const
Returns the Unicode text that this key generated.
void setContentsMargins(int left, int top, int right, int bottom)
int cursorPosition
the current cursor position for this line edit.
void selectAll()
Selects all the text (i.e.
bool hasSelectedText
whether there is any text selected.
int selectionStart() const
Returns the index of the first selected character in the line edit or -1 if no text is selected.
QString selectedText
the selected text.
void setCursorPosition(int)
void setText(const QString &)
void setSelection(int, int)
Selects text from position start and for length characters.
QString text
the line edit's text.
QString dateTimeFormat(FormatType format=LongFormat) const
QString dateFormat(FormatType format=LongFormat) const
QString timeFormat(FormatType format=LongFormat) const
QString toString(qlonglong i) const
Returns a localized string representation of i.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
The QPaintEvent class contains event parameters for paint events.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
constexpr void setX(int x) noexcept
Sets the x coordinate of this point to the given x coordinate.
bool isNull() const
Returns true if the referenced object has been destroyed or if there is no referenced object; otherwi...
\inmodule QtCore\reentrant
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void moveTo(int x, int t) noexcept
Moves the rectangle, leaving the top-left corner at the given position (x, y).
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
The QScreen class is used to query screen properties. \inmodule QtGui.
QRect availableGeometry
the screen's available geometry in pixels
Exception-safe wrapper around QObject::blockSignals().
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
qsizetype size() const
Returns the number of characters in this string.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
\variable QStyleOptionToolButton::features
QStyle::SubControls subControls
QStyle::SubControls activeSubControls
void initFrom(const QWidget *w)
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
StateFlag
This enum describes flags that are used when drawing primitive elements.
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
@ SE_DateTimeEditLayoutItem
SubControl
This enum describes the available sub controls.
QTimeEdit(QWidget *parent=nullptr)
Constructs an empty time editor with a parent.
void userTimeChanged(QTime time)
This signal only exists to fully implement the time Q_PROPERTY on the class.
constexpr Qt::TimeSpec timeSpec() const noexcept
\inmodule QtCore \reentrant
int hour() const
Returns the hour part (0 to 23) of the time.
int minute() const
Returns the minute part (0 to 59) of the time.
bool isValid() const
Returns true if the time is valid; otherwise returns false.
The QVBoxLayout class lines up widgets vertically.
State
This enum type defines the states in which a validated string can exist.
void clear()
Convert this variant to type QMetaType::UnknownType and free up any resources used.
QDateTime toDateTime() const
Returns the variant as a QDateTime if the variant has userType() \l QMetaType::QDateTime,...
QTime toTime() const
Returns the variant as a QTime if the variant has userType() \l QMetaType::QTime, \l QMetaType::QDate...
QDate toDate() const
Returns the variant as a QDate if the variant has userType() \l QMetaType::QDate, \l QMetaType::QDate...
Combined button and popup list for selecting options.
@ ActiveWindowFocusReason
static jboolean copy(JNIEnv *, jobject)
#define QDATETIMEEDIT_COMPAT_DATE_MIN
#define QDATETIMEEDIT_DATE_MIN
#define QDATETIMEEDIT_DATE_MAX
#define QDATETIMEEDIT_DATE_INITIAL
#define QDATETIMEEDIT_TIME_MIN
#define QDATETIMEEDIT_TIME_MAX
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLsizei const GLfloat * v
[13]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void GLsizei void void * span
GLenum GLenum GLenum input
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ASSERT_X(cond, x, msg)
static const struct TessellationWindingOrderTab cw[]
#define qPrintable(string)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
static double UTC(double t, double localTZA)
static double LocalTime(double t, double localTZA)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
selection select(topLeft, bottomRight)
static QString name(Section s)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent