4 #ifndef SWIFT_MISC_TESTVALUEOBJECT_H
5 #define SWIFT_MISC_TESTVALUEOBJECT_H
11 #include <type_traits>
13 #include <QDBusArgument>
47 CTestValueObject(
const QString &name,
const QString &description) : m_name(name), m_description(description) {}
50 const QString &
getName()
const {
return m_name; }
53 void setName(
const QString &name) { m_name = name; }
59 void setDescription(
const QString &description) { m_description = description; }
86 case IndexName: this->
setName(variant.
value<QString>());
break;
95 QString s(this->m_name);
96 s.append(
" ").append(this->m_description);
102 QString m_description;
114 bool operator<(
const CNotHashable &other)
const {
return n < other.n; }
115 QString toQString(
bool =
false)
const {
return {}; }
116 bool operator==(
const CNotHashable &other)
const {
return n == other.n; }
118 inline QJsonArray &
operator<<(QJsonArray &a,
const CNotHashable &) {
return a; }
119 inline const QJsonValueRef &
operator>>(
const QJsonValueRef &v, CNotHashable &) {
return v; }
120 inline QDBusArgument &
operator<<(QDBusArgument &a,
const CNotHashable &) {
return a; }
121 inline const QDBusArgument &
operator>>(
const QDBusArgument &a,
const CNotHashable &) {
return a; }
122 inline QDataStream &
operator<<(QDataStream &a,
const CNotHashable &) {
return a; }
123 inline QDataStream &
operator>>(QDataStream &a,
const CNotHashable &) {
return a; }
132 Q_DECLARE_METATYPE(swift::misc::CNotHashable)
152 static_assert(std::is_same<CValueObjectDictionary::impl_type, CValueObjectHashDictionary::impl_type>::value,
153 "Expected CValueObjectDictionary to use QHash");
154 static_assert(std::is_same<CNotHashableDictionary::impl_type, CNotHashableMapDictionary::impl_type>::value,
155 "Expected CDictionary<CNotHashableDictionary, Value> to use QMap");
Generic ordered container with value semantics.
Associative container with value semantics, chooses a sensible default implementation container type.
bool isMyself() const
Myself index, used with nesting.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
Generic sequential container with value semantics.
void setPropertyByIndex(const swift::misc::CPropertyIndex &index, const CVariant &variant)
Set property by index.
QString convertToQString(bool i18n=false) const
Cast as QString.
void setDescription(const QString &description)
Set description.
CTestValueObject(const QString &name, const QString &description)
Constructor.
CTestValueObject()
Default constructor.
const QString & getName() const
Get name.
void setName(const QString &name)
Set name.
const QString & getDescription() const
Get description.
CVariant propertyByIndex(const swift::misc::CPropertyIndex &index) const
Property by index.
Mix of the most commonly used mixin classes.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
T to() const
Synonym for value().
static CVariant fromValue(T &&value)
Construct a variant from a value.
T value() const
Return the value converted to the type T.
static CVariant from(T &&value)
Synonym for fromValue().
ColumnIndex
Base class enums.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
const QDBusArgument & operator>>(const QDBusArgument &arg, std::string &s)
Operator for std::string from QDBusArgument.
Free functions in swift::misc.
QDebug operator<<(QDebug d, const CRange< I > &range)
Streaming operators for CRange to qDebug.