diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-05 17:42:33 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-05 17:42:33 +0100 |
commit | 733ace5a7ad5b9e9f93ac87667d7d37fa5f894d5 (patch) | |
tree | a88031a8e1ac30986567070728e29ed1366d0962 /src/widgets/styles | |
parent | eaff48d3622bbb0e18e79f79aac6d1ac1b7e2760 (diff) | |
parent | 835b8213905b315645bc60ff5f2ab99340d075a2 (diff) | |
download | qtbase-733ace5a7ad5b9e9f93ac87667d7d37fa5f894d5.tar.gz |
Merge remote-tracking branch 'origin/release' into stable
Conflicts:
configure
mkspecs/macx-ios-clang/features/default_post.prf
tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
Change-Id: Iaba97eed2272bccf54289640b8197d40e22f7bf5
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstyleanimation.cpp | 15 |
2 files changed, 6 insertions, 11 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) : |