QKnxDate Class

The QKnxDate class is a datapoint type for a date. More...

Header: #include <QKnxDate>
qmake: QT += knx
Inherits: QKnxFixedSizeDatapointType

Public Functions

QKnxDate(quint16 year, quint8 month, quint8 day)
QKnxDate(const QDate &date)
QKnxDate()
quint8 day() const
quint8 month() const
bool setDay(quint8 day)
bool setMonth(quint8 month)
bool setValue(const QDate &date)
bool setYear(quint16 year)
QDate value() const
quint16 year() const

Reimplemented Public Functions

virtual bool isValid() const override

Detailed Description

This is a fixed size datapoint type with the length of 3 bytes.

The left byte of the data holds the day as 5 bits, the middle byte holds the month as 4 bits, and the right byte holds the year as 7 bits.

Valid dates are from Monday, 1990-01-01 to Saturday, 2089-12-31.

See also QKnxDatapointType and Qt KNX Datapoint Type Classes.

Member Function Documentation

QKnxDate::QKnxDate(quint16 year, quint8 month, quint8 day)

Creates a fixed size datapoint type with the year set to year, month to month, and day to day.

QKnxDate::QKnxDate(const QDate &date)

Creates a fixed size datapoint type with the date set to date.

QKnxDate::QKnxDate()

Creates a fixed size datapoint type with the date set to 2000, 0, 0.

quint8 QKnxDate::day() const

Returns the day stored in the datapoint type.

See also setDay().

[override virtual] bool QKnxDate::isValid() const

Reimplements: QKnxDatapointType::isValid() const.

quint8 QKnxDate::month() const

Returns the month stored in the datapoint type.

See also setMonth().

bool QKnxDate::setDay(quint8 day)

Sets the day to day.

If the value is outside the allowed range, returns false and does not set the value.

See also day().

bool QKnxDate::setMonth(quint8 month)

Sets the month to month.

If the value is outside the allowed range, returns false and does not set the value.

See also month().

bool QKnxDate::setValue(const QDate &date)

Sets the date stored in the datapoint type to date.

If the value is outside the allowed range, returns false and does not set the value.

See also value().

bool QKnxDate::setYear(quint16 year)

Sets the year to year.

If the value is outside the allowed range, returns false and does not set the value.

See also year().

QDate QKnxDate::value() const

Returns the date stored in the datapoint type.

See also setValue().

quint16 QKnxDate::year() const

Returns the year stored in the datapoint type.

See also setYear().

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.