summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qstyle.cpp2
-rw-r--r--src/widgets/styles/qstyleanimation.cpp15
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp2
3 files changed, 7 insertions, 12 deletions
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index 77f869f036..da9b5da2a5 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -619,7 +619,7 @@ void QStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, c
void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
const QPixmap &pixmap) const
{
- int scale = pixmap.devicePixelRatio();
+ qreal scale = pixmap.devicePixelRatio();
QRect aligned = alignedRect(QApplication::layoutDirection(), QFlag(alignment), pixmap.size() / scale, rect);
QRect inter = aligned.intersected(rect);
diff --git a/src/widgets/styles/qstyleanimation.cpp b/src/widgets/styles/qstyleanimation.cpp
index 4fb67d90c0..90fb371982 100644
--- a/src/widgets/styles/qstyleanimation.cpp
+++ b/src/widgets/styles/qstyleanimation.cpp
@@ -93,7 +93,10 @@ void QStyleAnimation::setStartTime(const QTime &time)
void QStyleAnimation::updateTarget()
{
QEvent event(QEvent::StyleAnimationUpdate);
+ event.setAccepted(false);
QCoreApplication::sendEvent(target(), &event);
+ if (!event.isAccepted())
+ stop();
}
bool QStyleAnimation::isUpdateNeeded() const
@@ -103,16 +106,8 @@ bool QStyleAnimation::isUpdateNeeded() const
void QStyleAnimation::updateCurrentTime(int)
{
- if (QObject *tgt = target()) {
- if (tgt->isWidgetType()) {
- QWidget *widget = static_cast<QWidget *>(tgt);
- if (!widget->isVisible() || widget->window()->isMinimized())
- stop();
- }
-
- if (isUpdateNeeded())
- updateTarget();
- }
+ if (target() && isUpdateNeeded())
+ updateTarget();
}
QProgressStyleAnimation::QProgressStyleAnimation(int speed, QObject *target) :
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index ab98dfbdcf..2f36e0e53c 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -5271,7 +5271,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton);
bool ruleMatch = rule.hasBox() || !rule.hasNativeBorder();
bool upRuleMatch = upRule.hasGeometry() || upRule.hasPosition();
- bool downRuleMatch = downRule.hasGeometry() || upRule.hasPosition();
+ bool downRuleMatch = downRule.hasGeometry() || downRule.hasPosition();
if (ruleMatch || upRuleMatch || downRuleMatch) {
switch (sc) {
case SC_SpinBoxFrame: