summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qproperty.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qproperty.h')
-rw-r--r--src/corelib/kernel/qproperty.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h
index 8f050327d5..e43f59053d 100644
--- a/src/corelib/kernel/qproperty.h
+++ b/src/corelib/kernel/qproperty.h
@@ -117,10 +117,8 @@ private:
class Q_CORE_EXPORT QUntypedPropertyBinding
{
public:
- // Returns either a boolean to indicate value change or an error.
- using BindingEvaluationResult = std::variant<bool, QPropertyBindingError>;
- // returns true if value changed, false if the binding evaluation lead to the same value as the property
- // already has.
+ using BindingEvaluationResult = QPropertyBindingError;
+ // writes binding result into dataPtr
using BindingEvaluationFunction = std::function<BindingEvaluationResult(const QMetaType &metaType, void *dataPtr)>;
QUntypedPropertyBinding();
@@ -160,13 +158,11 @@ class QPropertyBinding : public QUntypedPropertyBinding
if (auto valuePtr = std::get_if<PropertyType>(&result)) {
PropertyType *propertyPtr = reinterpret_cast<PropertyType *>(dataPtr);
- if (*propertyPtr == *valuePtr)
- return false;
*propertyPtr = std::move(*valuePtr);
- return true;
+ return {};
}
- return false;
+ return {};
}
};