Add compat
This commit is contained in:
parent
3a234066ef
commit
2f0077a5d1
@ -14,6 +14,7 @@ Build-Depends: debhelper,
|
||||
libnymea-zigbee-dev (>= 0.1.0),
|
||||
libnymea-gpio-dev,
|
||||
libpython3-dev,
|
||||
qtchooser,
|
||||
qt6-base-dev,
|
||||
qt6-base-dev-tools,
|
||||
qt6-websockets-dev,
|
||||
@ -21,8 +22,8 @@ Build-Depends: debhelper,
|
||||
qt6-declarative-dev,
|
||||
qt6-serialport-dev,
|
||||
qt6-serialbus-dev,
|
||||
qt6-5compat-dev,
|
||||
qml6-module-qtquick,
|
||||
qtchooser,
|
||||
libqt6bluetooth6,
|
||||
libqt6sql6-sqlite,
|
||||
libqt6dbus6 | libqt6dbus6t64,
|
||||
|
||||
@ -431,17 +431,17 @@ bool StateEvaluator::evaluateDescriptor(const StateDescriptor &descriptor) const
|
||||
|
||||
switch (descriptor.operatorType()) {
|
||||
case Types::ValueOperatorEquals:
|
||||
return state.value() == convertedValue;
|
||||
return state.value() == descriptorValue;
|
||||
case Types::ValueOperatorGreater:
|
||||
return state.value() > convertedValue;
|
||||
return state.value() > descriptorValue;
|
||||
case Types::ValueOperatorGreaterOrEqual:
|
||||
return state.value() >= convertedValue;
|
||||
return state.value() >= descriptorValue;
|
||||
case Types::ValueOperatorLess:
|
||||
return state.value() < convertedValue;
|
||||
return state.value() < descriptorValue;
|
||||
case Types::ValueOperatorLessOrEqual:
|
||||
return state.value() <= convertedValue;
|
||||
return state.value() <= descriptorValue;
|
||||
case Types::ValueOperatorNotEquals:
|
||||
return state.value() != convertedValue;
|
||||
return state.value() != descriptorValue;
|
||||
}
|
||||
#endif
|
||||
} else if (!descriptor.valueThingId().isNull() && !descriptor.valueStateTypeId().isNull()) {
|
||||
|
||||
@ -31,8 +31,21 @@ CONFIG += plugin link_pkgconfig
|
||||
|
||||
PKGCONFIG += nymea
|
||||
|
||||
QMAKE_CXXFLAGS *= -Werror -std=c++11 -g -Wno-deprecated-declarations
|
||||
QMAKE_LFLAGS *= -std=c++11 -z defs
|
||||
greaterThan(QT_MAJOR_VERSION, 5) {
|
||||
message("Building using Qt6 support")
|
||||
CONFIG *= c++17
|
||||
QMAKE_LFLAGS *= -std=c++17
|
||||
QMAKE_CXXFLAGS *= -std=c++17
|
||||
} else {
|
||||
message("Building using Qt5 support")
|
||||
CONFIG *= c++11
|
||||
QMAKE_LFLAGS *= -std=c++11
|
||||
QMAKE_CXXFLAGS *= -std=c++11
|
||||
DEFINES += QT_DISABLE_DEPRECATED_UP_TO=0x050F00
|
||||
}
|
||||
|
||||
QMAKE_CXXFLAGS *= -Werror -g -Wno-deprecated-declarations
|
||||
QMAKE_LFLAGS *= -z defs
|
||||
|
||||
JSONFILE=$${_PRO_FILE_PWD_}/integrationplugin"$$TARGET".json
|
||||
|
||||
|
||||
@ -41,6 +41,9 @@
|
||||
|
||||
#include <QAnyStringView>
|
||||
|
||||
// Note: do not overload the == operator, we just want a QUuid comparison with QUuid
|
||||
// ISO C++ says that these are ambiguous, even though the worst conversion for
|
||||
// the first is better than the worst conversion for the second
|
||||
#define DECLARE_TYPE_ID(type) class type##Id: public QUuid \
|
||||
{ \
|
||||
public: \
|
||||
|
||||
Reference in New Issue
Block a user