From 34a67b36528ce4f371ca972fb1fdb666da807f01 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 18 Feb 2020 14:56:44 +0100 Subject: [PATCH 1/6] Remove misplaced backslash from documentation A \c{} section is already rendered using monospace, no need to escape the \nullptr keyword explicitly. Change-Id: I004a409892809e968c7a73c68a5b3c54a4680425 Reviewed-by: Paul Wicking --- src/widgets/kernel/qwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index e7f95ecf4d6..5ac1ac698e9 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -392,7 +392,7 @@ void QWidget::setAutoFillBackground(bool enabled) Every widget's constructor accepts one or two standard arguments: \list 1 - \li \c{QWidget *parent = \nullptr} is the parent of the new widget. + \li \c{QWidget *parent = nullptr} is the parent of the new widget. If it is \nullptr (the default), the new widget will be a window. If not, it will be a child of \e parent, and be constrained by \e parent's geometry (unless you specify Qt::Window as window flag). From ce55667b62e77902c18d9a2a62e5e323516159d7 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 21 Feb 2020 15:05:09 +0100 Subject: [PATCH 2/6] Set the size of the buffer so it is big enough to hold the contents This will prevent a crash later on when it tries to assign to an index in a QString that has not been allocated. Fixes: QTBUG-81950 Change-Id: Ia0b5648a18f15594eeca07d234bedadcfeb266ac Reviewed-by: Mitch Curtis Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qlcdnumber.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qlcdnumber.cpp b/src/widgets/widgets/qlcdnumber.cpp index 282714843c9..8ac7040ea79 100644 --- a/src/widgets/widgets/qlcdnumber.cpp +++ b/src/widgets/widgets/qlcdnumber.cpp @@ -713,7 +713,7 @@ void QLCDNumber::paintEvent(QPaintEvent *) void QLCDNumberPrivate::internalSetString(const QString& s) { Q_Q(QLCDNumber); - QString buffer; + QString buffer(ndigits, QChar()); int i; int len = s.length(); QBitArray newPoints(ndigits); From 2c35a6102539510bb850f587690b036d96863338 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 21 Feb 2020 11:05:20 +0100 Subject: [PATCH 3/6] Delay the processing of the doc features to the end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By delaying it to the end we can be sure that all the Qt modules have their INCLUDEPATHs set and as a result we can avoid long command lines on Windows. Change-Id: I9068f7bf66fe138aad1a633191677a57dfd08d6e Reviewed-by: Paul Wicking Reviewed-by: Topi Reiniƶ Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_build_config.prf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf index 8273ba3fe14..511b158b917 100644 --- a/mkspecs/features/qt_build_config.prf +++ b/mkspecs/features/qt_build_config.prf @@ -91,10 +91,13 @@ android|uikit|winrt: \ # Prevent warnings about object files without any symbols macos: CONFIG += no_warn_empty_obj_files +# Make sure the doc features are loaded last since they depend on other +# features setting up things like includepaths to find everything. +CONFIG = prepare_docs qt_docs_targets $$CONFIG + CONFIG += \ utf8_source \ create_prl link_prl \ - prepare_docs qt_docs_targets \ no_private_qt_headers_warning QTDIR_build \ qt_example_installs \ # Qt modules get compiled without exceptions enabled by default. From 4403ec3bc1501cde454b0546759d4c27f9b6cb1b Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 18 Feb 2020 09:41:09 +0100 Subject: [PATCH 4/6] tests/xcb: fix tst_QWidget::updateWhileMinimized() on mutter/GNOME Shell Task-number: QTBUG-68862 Change-Id: I6247867ae4ec126ab0549741f2d2d491a7f2e8a0 Reviewed-by: Shawn Rutledge --- tests/auto/widgets/kernel/qwidget/BLACKLIST | 5 ----- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 12 +++++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index cf35491ec01..70ea8433a6d 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -8,11 +8,6 @@ b2qt opensuse-42.3 [restoreVersion1Geometry] ubuntu-16.04 -[updateWhileMinimized] -ubuntu-18.04 -rhel-7.4 -ubuntu-16.04 -rhel-7.6 [focusProxyAndInputMethods] rhel-7.6 opensuse-leap diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 2dd9e13b805..ce3419f8add 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -7914,7 +7914,17 @@ void tst_QWidget::updateWhileMinimized() QTest::qWait(10); if (m_platform == QStringLiteral("winrt")) QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort); - QCOMPARE(widget.numPaintEvents, 0); + int count = 0; + // mutter/GNOME Shell doesn't unmap when minimizing window. + // More details at https://gitlab.gnome.org/GNOME/mutter/issues/185 + if (m_platform == QStringLiteral("xcb")) { + const QString desktop = qgetenv("XDG_CURRENT_DESKTOP"); + qDebug() << "xcb: XDG_CURRENT_DESKTOP=" << desktop; + if (desktop == QStringLiteral("ubuntu:GNOME") + || desktop == QStringLiteral("GNOME-Classic:GNOME")) + count = 1; + } + QCOMPARE(widget.numPaintEvents, count); // Restore window. widget.showNormal(); From e59e5643b57e94e909b0dcd7111362b75d64fa94 Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Mon, 24 Feb 2020 00:37:17 +0100 Subject: [PATCH 5/6] Use QT_DEPRECATED_X instead of Q_DECL_DEPRECATED_X Allow deprecation warnings to be controlled with QT_NO_DEPRECATED_WARNINGS. Fixes: QTBUG-82424 Change-Id: I6df55ee2abaf4c141ac9b0e7661e46ba3706b20e Reviewed-by: Lars Knoll --- src/corelib/tools/qlist.h | 10 +++++----- src/corelib/tools/qset.h | 8 ++++---- src/corelib/tools/qvector.h | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 425ffa42a59..8e23556e863 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -406,16 +406,16 @@ public: static QList fromVector(const QVector &vector); QVector toVector() const; -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) - Q_DECL_DEPRECATED_X("Use QList(set.begin(), set.end()) instead.") +#if QT_DEPRECATED_SINCE(5, 14) && QT_VERSION < QT_VERSION_CHECK(6,0,0) + QT_DEPRECATED_X("Use QList(set.begin(), set.end()) instead.") static QList fromSet(const QSet &set); - Q_DECL_DEPRECATED_X("Use QSet(list.begin(), list.end()) instead.") + QT_DEPRECATED_X("Use QSet(list.begin(), list.end()) instead.") QSet toSet() const; - Q_DECL_DEPRECATED_X("Use QList(list.begin(), list.end()) instead.") + QT_DEPRECATED_X("Use QList(list.begin(), list.end()) instead.") static inline QList fromStdList(const std::list &list) { return QList(list.begin(), list.end()); } - Q_DECL_DEPRECATED_X("Use std::list(list.begin(), list.end()) instead.") + QT_DEPRECATED_X("Use std::list(list.begin(), list.end()) instead.") inline std::list toStdList() const { return std::list(begin(), end()); } #endif diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index 2e728321854..d0c2e8aa996 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -246,10 +246,10 @@ public: { QSet result = *this; result -= other; return result; } QList values() const; -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) - Q_DECL_DEPRECATED_X("Use values() instead.") +#if QT_DEPRECATED_SINCE(5, 14) && QT_VERSION < QT_VERSION_CHECK(6,0,0) + QT_DEPRECATED_X("Use values() instead.") QList toList() const { return values(); } - Q_DECL_DEPRECATED_X("Use QSet(list.begin(), list.end()) instead.") + QT_DEPRECATED_X("Use QSet(list.begin(), list.end()) instead.") static QSet fromList(const QList &list); #endif @@ -383,7 +383,7 @@ Q_OUTOFLINE_TEMPLATE QList QSet::values() const return result; } -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if QT_DEPRECATED_SINCE(5, 14) && QT_VERSION < QT_VERSION_CHECK(6,0,0) template Q_OUTOFLINE_TEMPLATE QSet QList::toSet() const { diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 62fbdb4a2ad..b8b9b7da40b 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -301,11 +301,11 @@ public: static QVector fromList(const QList &list); QList toList() const; -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) - Q_DECL_DEPRECATED_X("Use QVector(vector.begin(), vector.end()) instead.") +#if QT_DEPRECATED_SINCE(5, 14) && QT_VERSION < QT_VERSION_CHECK(6,0,0) + QT_DEPRECATED_X("Use QVector(vector.begin(), vector.end()) instead.") static inline QVector fromStdVector(const std::vector &vector) { return QVector(vector.begin(), vector.end()); } - Q_DECL_DEPRECATED_X("Use std::vector(vector.begin(), vector.end()) instead.") + QT_DEPRECATED_X("Use std::vector(vector.begin(), vector.end()) instead.") inline std::vector toStdVector() const { return std::vector(d->begin(), d->end()); } #endif From 3c4078ca02cc438dbe668c4a3819d54134ac75b5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 24 Feb 2020 13:33:00 +0100 Subject: [PATCH 6/6] tst_QSettings: Fix leaking registry key On Windows, the test was leaking a registry key HKEY_CURRENT_USER\Software\tst_QSettings_trailingWhitespace Fix by using .ini-Format in the temporary directory created by the test. Amends e66a878838f17a0626b0b10b340b1ca4dba56cc1. Task-number: QTBUG-22461 Change-Id: If141a9e72e8faebc3fc46b94dab7b4b728a75292 Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 0f07ba4bb2e..57bab115bbd 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -2331,14 +2331,15 @@ void tst_QSettings::testRegistry32And64Bit() void tst_QSettings::trailingWhitespace() { + const QString path = settingsPath("trailingWhitespace"); { - QSettings s("tst_QSettings_trailingWhitespace"); + QSettings s(path, QSettings::IniFormat); s.setValue("trailingSpace", "x "); s.setValue("trailingTab", "x\t"); s.setValue("trailingNewline", "x\n"); } { - QSettings s("tst_QSettings_trailingWhitespace"); + QSettings s(path, QSettings::IniFormat); QCOMPARE(s.value("trailingSpace").toString(), QLatin1String("x ")); QCOMPARE(s.value("trailingTab").toString(), QLatin1String("x\t")); QCOMPARE(s.value("trailingNewline").toString(), QLatin1String("x\n"));