summaryrefslogtreecommitdiffstats
path: root/examples/corelib/bindableproperties/subscription/subscription.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/corelib/bindableproperties/subscription/subscription.cpp')
-rw-r--r--examples/corelib/bindableproperties/subscription/subscription.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/corelib/bindableproperties/subscription/subscription.cpp b/examples/corelib/bindableproperties/subscription/subscription.cpp
index 16bb6cfdd6..85cc5798cc 100644
--- a/examples/corelib/bindableproperties/subscription/subscription.cpp
+++ b/examples/corelib/bindableproperties/subscription/subscription.cpp
@@ -15,7 +15,7 @@ void Subscription::calculatePrice()
{
const auto oldPrice = m_price;
- m_price = qRound(calculateDiscount() * m_duration * basePrice());
+ m_price = qRound(calculateDiscount() * int(m_duration) * basePrice());
if (m_price != oldPrice)
emit priceChanged();
}
@@ -57,10 +57,10 @@ double Subscription::calculateDiscount() const
int Subscription::basePrice() const
{
- if (m_user->country() == User::None)
+ if (m_user->country() == User::Country::AnyTerritory)
return 0;
- return (m_user->country() == User::Norway) ? 100 : 80;
+ return (m_user->country() == User::Country::Norway) ? 100 : 80;
}
//! [calculate-base-price]
@@ -70,7 +70,7 @@ int Subscription::basePrice() const
void Subscription::updateValidity()
{
bool isValid = m_isValid;
- m_isValid = m_user->country() != User::None && m_user->age() > 12;
+ m_isValid = m_user->country() != User::Country::AnyTerritory && m_user->age() > 12;
if (m_isValid != isValid)
emit isValidChanged();