summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-10-17 09:41:36 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-10-17 09:41:36 +0200
commit02164e0288f714f1ea93afb32548548686773d1d (patch)
treed7ed16267f7659af63e78c8de8915ed0208b598b /src/widgets
parent4a7e7103e713448c05d9d30cab8b7e52406b46a6 (diff)
parent6f27bb135246b7fe9d11ba58e05d2b7661bc2080 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qdesktopwidget.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp8
-rw-r--r--src/widgets/util/qscroller.cpp3
-rw-r--r--src/widgets/widgets/qeffects.cpp2
5 files changed, 15 insertions, 2 deletions
diff --git a/src/widgets/kernel/qdesktopwidget.cpp b/src/widgets/kernel/qdesktopwidget.cpp
index 4fbe6bba3f..9e90adec46 100644
--- a/src/widgets/kernel/qdesktopwidget.cpp
+++ b/src/widgets/kernel/qdesktopwidget.cpp
@@ -211,7 +211,9 @@ QDesktopWidget::QDesktopWidget()
setObjectName(QLatin1String("desktop"));
d->_q_updateScreens();
connect(qApp, SIGNAL(screenAdded(QScreen*)), this, SLOT(_q_updateScreens()));
+#if QT_DEPRECATED_SINCE(5, 11)
connect(qApp, SIGNAL(primaryScreenChanged(QScreen*)), this, SIGNAL(primaryScreenChanged()));
+#endif
}
QDesktopWidget::~QDesktopWidget()
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 65b3326387..0f2e2545cd 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -2909,6 +2909,8 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
{
Q_D(QWidget);
Qt::WindowStates oldstate = windowState();
+ if (newstate.testFlag(Qt::WindowMinimized)) // QTBUG-46763
+ newstate.setFlag(Qt::WindowActive, false);
if (oldstate == newstate)
return;
if (isWindow() && !testAttribute(Qt::WA_WState_Created))
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 88c6c288e8..3f57992311 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -5035,6 +5035,14 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder() || subRule.hasFont) {
sz = subRule.adjustSize(csz);
+ if (!sz.isValid()) {
+ // Try to set the missing values based on the base style.
+ const auto baseSize = baseStyle()->sizeFromContents(ct, opt, sz, w);
+ if (sz.width() < 0)
+ sz.setWidth(baseSize.width());
+ if (sz.height() < 0)
+ sz.setHeight(baseSize.height());
+ }
if (!subRule.hasGeometry()) {
QSize nativeContentsSize;
bool nullIcon = hdr->icon.isNull();
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp
index 1e84237253..df05bbf71c 100644
--- a/src/widgets/util/qscroller.cpp
+++ b/src/widgets/util/qscroller.cpp
@@ -1031,7 +1031,8 @@ void QScrollerPrivate::setDpi(const QPointF &dpi)
*/
void QScrollerPrivate::setDpiFromWidget(QWidget *widget)
{
- const QScreen *screen = QGuiApplication::screens().at(QApplication::desktop()->screenNumber(widget));
+ const QScreen *screen = widget ? widget->screen() : QGuiApplication::primaryScreen();
+ Q_ASSERT(screen);
setDpi(QPointF(screen->physicalDotsPerInchX(), screen->physicalDotsPerInchY()));
}
diff --git a/src/widgets/widgets/qeffects.cpp b/src/widgets/widgets/qeffects.cpp
index 9463641369..7069ef0368 100644
--- a/src/widgets/widgets/qeffects.cpp
+++ b/src/widgets/widgets/qeffects.cpp
@@ -99,7 +99,7 @@ static QAlphaWidget* q_blend = 0;
Constructs a QAlphaWidget.
*/
QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED // QDesktopWidget::screen()
+QT_WARNING_DISABLE_DEPRECATED // ### Qt 6: Find a replacement for QDesktopWidget::screen()
QAlphaWidget::QAlphaWidget(QWidget* w, Qt::WindowFlags f)
: QWidget(QApplication::desktop()->screen(QDesktopWidgetPrivate::screenNumber(w)), f)
{