Update doc saying QDateTime::setTime with invalid time sets to midnight

QDateTimePrivate::setDateTime has a comment saying this is intentional,
so document it.

Task-number: QTBUG-43704
Change-Id: Ic5d393bfd36e48a193fcffff13b965409eaf7be9
Reviewed-by: Martin Smith <martin.smith@digia.com>
bb10
Thiago Macieira 2015-01-14 15:34:45 -08:00
parent 13ecde3b7a
commit c3590c7677
1 changed files with 10 additions and 3 deletions

View File

@ -3296,8 +3296,8 @@ bool QDateTime::isDaylightTime() const
}
/*!
Sets the date part of this datetime to \a date.
If no time is set, it is set to midnight.
Sets the date part of this datetime to \a date. If no time is set yet, it
is set to midnight. If \a date is invalid, this QDateTime becomes invalid.
\sa date(), setTime(), setTimeSpec()
*/
@ -3309,7 +3309,14 @@ void QDateTime::setDate(const QDate &date)
}
/*!
Sets the time part of this datetime to \a time.
Sets the time part of this datetime to \a time. If \a time is not valid,
this function sets it to midnight. Therefore, it's possible to clear any
set time in a QDateTime by setting it to a default QTime:
\code
QDateTime dt = QDateTime::currentDateTime();
dt.setTime(QTime());
\endcode
\sa time(), setDate(), setTimeSpec()
*/