QDateTime: code tidies
Move the ValidityMask / DaylightMask enumerators in the right enumeration. This allows to use them in a type-safe way through the StatusFlags flag type. Also, define the flag operators for StatusFlags. Change-Id: Icdba7c3f49f18ffb4aff9921d8012ddc3f7cbed7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
37e3b988c2
commit
aaaa5c6d82
@ -101,14 +101,14 @@ public:
|
|||||||
TimeSpecMask = 0x30,
|
TimeSpecMask = 0x30,
|
||||||
|
|
||||||
SetToStandardTime = 0x40,
|
SetToStandardTime = 0x40,
|
||||||
SetToDaylightTime = 0x80
|
SetToDaylightTime = 0x80,
|
||||||
|
ValidityMask = ValidDate | ValidTime | ValidDateTime,
|
||||||
|
DaylightMask = SetToStandardTime | SetToDaylightTime,
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(StatusFlags, StatusFlag)
|
Q_DECLARE_FLAGS(StatusFlags, StatusFlag)
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
TimeSpecShift = 4,
|
TimeSpecShift = 4,
|
||||||
ValidityMask = ValidDate | ValidTime | ValidDateTime,
|
|
||||||
DaylightMask = SetToStandardTime | SetToDaylightTime
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static QDateTime::Data create(QDate toDate, QTime toTime, Qt::TimeSpec toSpec,
|
static QDateTime::Data create(QDate toDate, QTime toTime, Qt::TimeSpec toSpec,
|
||||||
@ -139,6 +139,8 @@ public:
|
|||||||
#endif // timezone
|
#endif // timezone
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimePrivate::StatusFlags)
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QDATETIME_P_H
|
#endif // QDATETIME_P_H
|
||||||
|
Loading…
Reference in New Issue
Block a user