summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2016-11-03 16:08:55 +0000
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2017-01-12 22:16:06 +0000
commit6255cb893d411b055758f2e64e94fde0bce91ea8 (patch)
treed8e445c85d6cd386c2228776001b372d01fbbef7 /src/widgets/styles
parenta4c25c020554527aa9ff9b533afabffef46be131 (diff)
Remove qtypetraits.h's contents altogether
So that QFlags can use an (un)signed int matching the underlying type as identified by the compiler and not by us. Requires fixing a few warnings about sign conversion due to QFlags misusages in qtbase that were either plain wrong, or were relying on the enum being backed by an (un)signed int when it wasn't. Keep qtypetraits.h in the source tree in order to prevent source breaks if some downstream #includes it (note however that it did not contain any public API). Change-Id: Ib3a92b98db7031e793a088fb2a3b306eff4d7a3c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qfusionstyle.cpp4
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 74e4d53dca..70af751fd3 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -2417,7 +2417,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
int oldMin = styleObject->property("_q_stylemin").toInt();
int oldMax = styleObject->property("_q_stylemax").toInt();
QRect oldRect = styleObject->property("_q_stylerect").toRect();
- int oldState = styleObject->property("_q_stylestate").toInt();
+ QStyle::State oldState = static_cast<QStyle::State>(styleObject->property("_q_stylestate").value<QStyle::State::Int>());
uint oldActiveControls = styleObject->property("_q_stylecontrols").toUInt();
// a scrollbar is transient when the the scrollbar itself and
@@ -2440,7 +2440,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
styleObject->setProperty("_q_stylemin", scrollBar->minimum);
styleObject->setProperty("_q_stylemax", scrollBar->maximum);
styleObject->setProperty("_q_stylerect", scrollBar->rect);
- styleObject->setProperty("_q_stylestate", static_cast<int>(scrollBar->state));
+ styleObject->setProperty("_q_stylestate", static_cast<QStyle::State::Int>(scrollBar->state));
styleObject->setProperty("_q_stylecontrols", static_cast<uint>(scrollBar->activeSubControls));
#ifndef QT_NO_ANIMATION
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 272877130b..ee257c7310 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -5284,7 +5284,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
int oldMin = styleObject->property("_q_stylemin").toInt();
int oldMax = styleObject->property("_q_stylemax").toInt();
QRect oldRect = styleObject->property("_q_stylerect").toRect();
- int oldState = styleObject->property("_q_stylestate").toInt();
+ QStyle::State oldState = static_cast<QStyle::State>(styleObject->property("_q_stylestate").value<QStyle::State::Int>());
uint oldActiveControls = styleObject->property("_q_stylecontrols").toUInt();
// a scrollbar is transient when the scrollbar itself and
@@ -5307,7 +5307,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
styleObject->setProperty("_q_stylemin", slider->minimum);
styleObject->setProperty("_q_stylemax", slider->maximum);
styleObject->setProperty("_q_stylerect", slider->rect);
- styleObject->setProperty("_q_stylestate", static_cast<int>(slider->state));
+ styleObject->setProperty("_q_stylestate", static_cast<QStyle::State::Int>(slider->state));
styleObject->setProperty("_q_stylecontrols", static_cast<uint>(slider->activeSubControls));
QScrollbarStyleAnimation *anim = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject));