examples/: fix compiler warnings -Wdeprecated-enum-float-conversion

This is with GCC.

Change-Id: I52dcb6881f36c740129b699db7db9241a4e75da1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ahmad Samir 2023-07-21 19:41:39 +03:00
parent 339323b999
commit ad6fd04609
3 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -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();
}

View File

@ -49,7 +49,7 @@ private:
bool restart = false;
bool abort = false;
enum { ColormapSize = 512 };
static constexpr int ColormapSize = 512;
uint colormap[ColormapSize];
};
//! [0]