now return an empty QString, QStringRef or QByteArray respectively.
in Qt 4 they returned a null QString or a null QStringRef.
+* QDate, QTime, and QDateTime have undergone important behavioural changes:
+ * QDate::setYMD() is deprecated, use QDate::setDate() instead
+
+
QtGui
-----
* Accessibility has been refactored. The hierachy of accessible objects is implemented via
#endif //QT_NO_DATESTRING
/*!
- \obsolete
+ \fn bool setYMD(int y, int m, int d)
+
+ \deprecated in 5.0, use setDate() instead.
Sets the date's year \a y, month \a m, and day \a d.
Use setDate() instead.
*/
-bool QDate::setYMD(int y, int m, int d)
-{
- if (uint(y) <= 99)
- y += 1900;
- return setDate(y, m, d);
-}
-
/*!
\since 4.2
QString toString(Qt::DateFormat f = Qt::TextDate) const;
QString toString(const QString &format) const;
#endif
- bool setYMD(int y, int m, int d);
+#if QT_DEPRECATED_SINCE(5,0)
+QT_DEPRECATED inline bool setYMD(int y, int m, int d)
+{ if (uint(y) <= 99) y += 1900; return setDate(y, m, d); }
+#endif
+
bool setDate(int year, int month, int day);
void getDate(int *year, int *month, int *day);
a.endStructure();
if (y != 0 && m != 0 && d != 0)
- date.setYMD(y, m, d);
+ date.setDate(y, m, d);
else
date = QDate();
return a;
const int futureTolerance = 86400;
if (dateTime->secsTo(QDateTime::currentDateTime()) < -futureTolerance) {
QDate d = dateTime->date();
- d.setYMD(d.year() - 1, d.month(), d.day());
+ d.setDate(d.year() - 1, d.month(), d.day());
dateTime->setDate(d);
}
}
QVERIFY(QDate::isValid(1, 2, 3));
QVERIFY(QDate::isValid(-1, 2, 3));
+#if QT_DEPRECATED_SINCE(5,0)
{
QDate dt;
dt.setYMD(1, 2, 3);
QCOMPARE(dt.month(), 2);
QCOMPARE(dt.day(), 3);
}
+#endif
{
QDate dt;