QMetaProperty: add writeOnGadget() overload taking rvalue QVariant
The writeOnGadget() function is implemented in terms of write() (UB,
btw, due to the cast to QObject*), which was recently overloaded for
rvalue QVariants.
Add a corresponding writeOnGadget() overload, too.
[ChangeLog][QtCore][QMetaProperty] Added writeOnGadget() overload
taking an rvalue QVariant.
Amends 968250ee14.
Task-number: QTBUG-112762
Change-Id: I7fc686fcab293159f5a0d76dd6c8e23d5779c96c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
bb10
parent
426b5fbce4
commit
b6d04c8a82
|
|
@ -3806,6 +3806,16 @@ bool QMetaProperty::writeOnGadget(void *gadget, const QVariant &value) const
|
|||
return write(reinterpret_cast<QObject*>(gadget), value);
|
||||
}
|
||||
|
||||
/*!
|
||||
\overload
|
||||
\since 6.6
|
||||
*/
|
||||
bool QMetaProperty::writeOnGadget(void *gadget, QVariant &&value) const
|
||||
{
|
||||
Q_ASSERT(priv(mobj->d.data)->flags & PropertyAccessInStaticMetaCall && mobj->d.static_metacall);
|
||||
return write(reinterpret_cast<QObject*>(gadget), std::move(value));
|
||||
}
|
||||
|
||||
/*!
|
||||
\since 5.5
|
||||
|
||||
|
|
|
|||
|
|
@ -370,6 +370,7 @@ public:
|
|||
|
||||
QVariant readOnGadget(const void *gadget) const;
|
||||
bool writeOnGadget(void *gadget, const QVariant &value) const;
|
||||
bool writeOnGadget(void *gadget, QVariant &&value) const;
|
||||
bool resetOnGadget(void *gadget) const;
|
||||
|
||||
bool hasStdCppSet() const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue