summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-07-21 19:41:39 +0300
committerAhmad Samir <a.samirh78@gmail.com>2023-08-18 23:35:52 +0300
commitad6fd04609c94373ace8711f8e10c322b68436b2 (patch)
tree48a254925308ee9df07e124ada502dab629c28ed /examples
parent339323b999feed077adecc0afaa215f8caffc043 (diff)
examples/: fix compiler warnings -Wdeprecated-enum-float-conversion
This is with GCC. Change-Id: I52dcb6881f36c740129b699db7db9241a4e75da1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp3
-rw-r--r--examples/corelib/bindableproperties/subscription/subscription.cpp2
-rw-r--r--examples/corelib/threads/mandelbrot/renderthread.h2
3 files changed, 4 insertions, 3 deletions
diff --git a/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp b/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp
index 8b8321859b..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;
diff --git a/examples/corelib/bindableproperties/subscription/subscription.cpp b/examples/corelib/bindableproperties/subscription/subscription.cpp
index 5d040f76d9..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();
}
diff --git a/examples/corelib/threads/mandelbrot/renderthread.h b/examples/corelib/threads/mandelbrot/renderthread.h
index 6e509eee94..ecd8ae084d 100644
--- a/examples/corelib/threads/mandelbrot/renderthread.h
+++ b/examples/corelib/threads/mandelbrot/renderthread.h
@@ -49,7 +49,7 @@ private:
bool restart = false;
bool abort = false;
- enum { ColormapSize = 512 };
+ static constexpr int ColormapSize = 512;
uint colormap[ColormapSize];
};
//! [0]