diff options
Diffstat (limited to 'src/gui/widgets/qdatetimeedit.cpp')
-rw-r--r-- | src/gui/widgets/qdatetimeedit.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp index ea39349..5ddf7f7 100644 --- a/src/gui/widgets/qdatetimeedit.cpp +++ b/src/gui/widgets/qdatetimeedit.cpp @@ -220,6 +220,9 @@ QDateTimeEdit::QDateTimeEdit(const QVariant &var, QVariant::Type parserType, QWi \property QDateTimeEdit::dateTime \brief the QDateTime that is set in the QDateTimeEdit + When setting this property the timespec of the QDateTimeEdit remains the same + and the timespec of the new QDateTime is ignored. + By default, this property contains a date that refers to January 1, 2000 and a time of 00:00:00 and 0 milliseconds. @@ -239,7 +242,7 @@ void QDateTimeEdit::setDateTime(const QDateTime &datetime) d->clearCache(); if (!(d->sections & DateSections_Mask)) setDateRange(datetime.date(), datetime.date()); - d->setValue(QVariant(datetime), EmitIfChanged); + d->setValue(QDateTime(datetime.date(), datetime.time(), d->spec), EmitIfChanged); } } @@ -932,9 +935,6 @@ void QDateTimeEdit::setCalendarPopup(bool enable) \property QDateTimeEdit::timeSpec \brief the current timespec used by the date time edit. \since 4.4 - - All dates/passed to the date time edit will be converted to this - timespec. */ Qt::TimeSpec QDateTimeEdit::timeSpec() const @@ -1934,7 +1934,6 @@ QDateTime QDateTimeEditPrivate::validateAndInterpret(QString &input, int &positi /*! \internal - \reimp */ QString QDateTimeEditPrivate::textFromValue(const QVariant &f) const @@ -1945,7 +1944,6 @@ QString QDateTimeEditPrivate::textFromValue(const QVariant &f) const /*! \internal - \reimp This function's name is slightly confusing; it is not to be confused with QAbstractSpinBox::valueFromText(). @@ -2103,7 +2101,6 @@ QDateTime QDateTimeEditPrivate::stepBy(int sectionIndex, int steps, bool test) c /*! \internal - \reimp */ void QDateTimeEditPrivate::emitSignals(EmitPolicy ep, const QVariant &old) @@ -2133,7 +2130,6 @@ void QDateTimeEditPrivate::emitSignals(EmitPolicy ep, const QVariant &old) /*! \internal - \reimp */ void QDateTimeEditPrivate::_q_editorCursorPositionChanged(int oldpos, int newpos) |