summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-01-29 10:02:38 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-01-29 10:05:01 +0100
commit55162dae7e5e40bd86b1a6d2c5d5009660159d39 (patch)
tree30b54dfc19cb83ac0edb795bf206b51edd805c97 /src/widgets
parent3527fd62c2705a0292458dd751d9d7f8d4be357f (diff)
parent6430d6e3ec31afabe0e674397088dd6d9e056195 (diff)
Merge remote-tracking branch 'origin/5.4.1' into 5.4
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp4
-rw-r--r--src/widgets/kernel/qapplication.cpp8
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm11
3 files changed, 11 insertions, 12 deletions
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index effcef2bc9..391c1d4fb9 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -1906,7 +1906,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
"<p>Qt and the Qt logo are trademarks of Digia Plc and/or its subsidiary(-ies).</p>"
"<p>Qt is a Digia product developed as an open source project. See <a href=\"http://%3/\">%3</a> "
"for more information.</p>"
- ).arg(QStringLiteral("2014"),
+ ).arg(QStringLiteral("2015"),
QStringLiteral("qt.io/licensing"),
QStringLiteral("qt.io"));
QMessageBox *msgBox = new QMessageBox(parent);
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index b7d0869289..abd0231b00 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3320,12 +3320,10 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QWidget* w = static_cast<QWidget *>(receiver);
QWheelEvent* wheel = static_cast<QWheelEvent*>(e);
- // QTBUG-40656, combo and other popups should close when the main window gets a wheel event.
- while (QWidget *popup = QApplication::activePopupWidget()) {
+ // QTBUG-40656, QTBUG-42731: ignore wheel events when a popup (QComboBox) is open.
+ if (const QWidget *popup = QApplication::activePopupWidget()) {
if (w->window() != popup)
- popup->close();
- else
- break;
+ return true;
}
QPoint relpos = wheel->pos();
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index c166b1b26e..38c082baf5 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1675,13 +1675,14 @@ void QMacStylePrivate::getSliderInfo(QStyle::ComplexControl cc, const QStyleOpti
else
tdi->max = 10 * slider->rect.height();
- if (usePlainKnob || slider->orientation == Qt::Horizontal) {
+ int range = slider->maximum - slider->minimum;
+ if (range == 0) {
+ tdi->value = 0;
+ } else if (usePlainKnob || slider->orientation == Qt::Horizontal) {
int endsCorrection = usePlainKnob ? 25 : 10;
- tdi->value = (tdi->max + 2 * endsCorrection) * (slider->sliderPosition - slider->minimum)
- / (slider->maximum - slider->minimum) - endsCorrection;
+ tdi->value = (tdi->max + 2 * endsCorrection) * (slider->sliderPosition - slider->minimum) / range - endsCorrection;
} else {
- tdi->value = (tdi->max + 30) * (slider->sliderPosition - slider->minimum)
- / (slider->maximum - slider->minimum) - 20;
+ tdi->value = (tdi->max + 30) * (slider->sliderPosition - slider->minimum) / range - 20;
}
}
tdi->attributes = kThemeTrackShowThumb;