Commit b263d59d authored by Volker Krause's avatar Volker Krause
Browse files

Make JNI string properties directly comparable with Qt string types

This makes string comparison work with Qt6 without needing an explicit
cast as well.
parent ceeb72aa
Pipeline #188181 passed with stage
in 3 minutes and 44 seconds
......@@ -112,6 +112,14 @@ public:
this->handle().setField(Jni::typeName<NameHolder>(), Jni::signature<PropType>(), Jni::reverse_converter<PropType>::type::convert(value).object());
return *this;
// special case for string comparison, which is often done against different types and thus the implicit conversion operator
// isn't going to be enough
template <typename CmpT, typename = std::enable_if_t<std::is_same_v<PropType, java::lang::String>, CmpT>>
inline bool operator==(const CmpT &other) const
return QString(*this) == other;
template <typename PropType, typename ClassType, typename NameHolder, typename OffsetHolder>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment