diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-11-06 01:00:08 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-11-06 11:41:19 +0100 |
commit | e3cc16e9fba045b3d195bc0e35dff4735bb6f59c (patch) | |
tree | a048d9ecb07ae175b4b357216c7e3e74d41c1271 /src/widgets | |
parent | 2e63d121839dae2794685001563783eea4c997f0 (diff) | |
parent | 7f0aaa88ef1db3840bd504d63a38d53032b8f802 (diff) |
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
.qmake.conf
mkspecs/features/mac/default_post.prf
src/corelib/tools/qsimd_p.h
src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
util/qfloat16-tables/gen_qfloat16_tables.cpp
Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc | 7 | ||||
-rw-r--r-- | src/widgets/itemviews/qtreewidget.cpp | 5 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 12 |
4 files changed, 23 insertions, 5 deletions
diff --git a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc index 84233e4b62..c8f374a1b1 100644 --- a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc +++ b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -59,6 +59,11 @@ \li \l{Qt Style Sheets Examples} \endlist + \note If Qt Style Sheets are used on the same widget as functions that + set the appearance of widgets, such as \l QWidget::setFont() or + \l QTreeWidgetItem::setBackground(), style sheets will take precedence + if the settings conflict. + \target overview \section1 Overview diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp index a2d6e7798d..6d0909108b 100644 --- a/src/widgets/itemviews/qtreewidget.cpp +++ b/src/widgets/itemviews/qtreewidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. @@ -1286,6 +1286,9 @@ bool QTreeWidgetItem::isFirstColumnSpanned() const Sets the background brush of the label in the given \a column to the specified \a brush. + \note If \l{Qt Style Sheets} are used on the same widget as setBackground(), + style sheets will take precedence if the settings conflict. + \sa setForeground() */ diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 74aebd1223..e9968e41b4 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1,4 +1,4 @@ -/**************************************************************************** +/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. @@ -8168,6 +8168,8 @@ void QWidgetPrivate::showChildren(bool spontaneous) QList<QObject*> childList = children; for (int i = 0; i < childList.size(); ++i) { QWidget *widget = qobject_cast<QWidget*>(childList.at(i)); + if (widget && widget->windowHandle() && !widget->testAttribute(Qt::WA_WState_ExplicitShowHide)) + widget->setAttribute(Qt::WA_WState_Hidden, false); if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden)) diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 24f8c5ce43..596343c52f 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -72,10 +72,18 @@ public: void setVisible(bool visible) override { Q_Q(QWidgetWindow); - if (QWidget *widget = q->widget()) + if (QWidget *widget = q->widget()) { + // Check if the widget was already hidden, as this indicates it was done + // explicitly and not because the parent window in this case made it hidden. + // In which case do not automatically show the widget when the parent + // window is shown. + const bool wasHidden = widget->testAttribute(Qt::WA_WState_Hidden); QWidgetPrivate::get(widget)->setVisible(visible); - else + if (!wasHidden) + widget->setAttribute(Qt::WA_WState_ExplicitShowHide, false); + } else { QWindowPrivate::setVisible(visible); + } } QWindow *eventReceiver() override { |