summaryrefslogtreecommitdiffstats
path: root/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp')
-rw-r--r--examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp b/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp
index a52b68f85b..32f4194635 100644
--- a/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp
+++ b/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp
@@ -10,7 +10,8 @@ BindableSubscription::BindableSubscription(BindableUser *user) : m_user(user)
{
Q_ASSERT(user);
- m_price.setBinding([this] { return qRound(calculateDiscount() * m_duration * basePrice()); });
+ m_price.setBinding(
+ [this] { return qRound(calculateDiscount() * int(m_duration) * basePrice()); });
m_isValid.setBinding([this] {
return m_user->country() != BindableUser::Country::AnyCountry && m_user->age() > 12;
@@ -38,8 +39,7 @@ double BindableSubscription::calculateDiscount() const
case Yearly:
return 0.6;
}
- Q_ASSERT(false);
- return -1;
+ Q_UNREACHABLE_RETURN(-1);
}
int BindableSubscription::basePrice() const