summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qproperty.h
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2024-02-02 14:34:54 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2024-02-03 00:48:20 +0100
commit216af5d7f9675a408e22167b097f221beeeb88db (patch)
tree805a858795c1e968e76fed311492b8da249ba82a /src/corelib/kernel/qproperty.h
parent4b64df56509dd770002ec083ee64f3ec23a8b682 (diff)
Fix usage of std::enable_if_t to SFINAE out QProperty APIs
Declare an IfUntypedPropertyData alias and use that consistently. Amends 311f8896322bcd39d33369c8311a8c89ccdad449. Pick-to: 6.7 Change-Id: If36ef8e2f9ce25e0ffe7b4b448c31ea5866acfc3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qproperty.h')
-rw-r--r--src/corelib/kernel/qproperty.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h
index 54df12fbfe..0373867a66 100644
--- a/src/corelib/kernel/qproperty.h
+++ b/src/corelib/kernel/qproperty.h
@@ -263,8 +263,7 @@ public:
QPropertyObserver &operator=(QPropertyObserver &&other) noexcept;
~QPropertyObserver();
- template <typename Property,
- typename = std::enable_if_t<std::is_base_of_v<QUntypedPropertyData, Property>>>
+ template <typename Property, QtPrivate::IsUntypedPropertyData<Property> = true>
void setSource(const Property &property)
{ setSource(property.bindingData()); }
void setSource(const QtPrivate::QPropertyBindingData &property);
@@ -303,8 +302,7 @@ public:
{
}
- template <typename Property,
- typename = std::enable_if_t<std::is_base_of_v<QUntypedPropertyData, Property>>>
+ template <typename Property, QtPrivate::IsUntypedPropertyData<Property> = true>
Q_NODISCARD_CTOR
QPropertyChangeHandler(const Property &property, Functor handler)
: QPropertyObserver([](QPropertyObserver *self, QUntypedPropertyData *) {
@@ -335,7 +333,7 @@ public:
}
template <typename Functor, typename Property,
- typename = std::enable_if_t<std::is_base_of_v<QUntypedPropertyData, Property>>>
+ QtPrivate::IsUntypedPropertyData<Property> = true>
Q_NODISCARD_CTOR
QPropertyNotifier(const Property &property, Functor handler)
: QPropertyObserver([](QPropertyObserver *self, QUntypedPropertyData *) {
@@ -909,8 +907,7 @@ public:
iface->setObserver(aliasedProperty(), this);
}
- template <typename Property,
- typename = std::enable_if_t<std::is_base_of_v<QUntypedPropertyData, Property>>>
+ template <typename Property, QtPrivate::IsUntypedPropertyData<Property> = true>
QPropertyAlias(Property *property)
: QPropertyObserver(property),
iface(&QtPrivate::QBindableInterfaceForProperty<Property>::iface)