From f121f319b9a90e58eda1bf3fb186d4e8a7861ad2 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 27 Sep 2019 16:17:22 +0200 Subject: examples: Fix -Wdeprecated-copy warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit examples/corelib/tools/customtypesending/window.cpp: In member function ‘void Window::sendMessage()’: examples/corelib/tools/customtypesending/window.cpp:79:71: warning: implicitly-declared ‘Message& Message::operator=(const Message&)’ is deprecated [-Wdeprecated-copy] 79 | thisMessage = Message(editor->toPlainText(), thisMessage.headers()); | ^ In file included from examples/corelib/tools/customtypesending/window.h:55, from examples/corelib/tools/customtypesending/window.cpp:52: examples/corelib/tools/customtypesending/message.h:62:5: note: because ‘Message’ has user-provided ‘Message::Message(const Message&)’ 62 | Message(const Message &other); | ^~~~~~~ examples/corelib/tools/customtypesending/window.cpp: In member function ‘void Window::setMessage(const Message&)’: examples/corelib/tools/customtypesending/window.cpp:87:19: warning: implicitly-declared ‘Message& Message::operator=(const Message&)’ is deprecated [-Wdeprecated-copy] 87 | thisMessage = message; | ^~~~~~~ In file included from examples/corelib/tools/customtypesending/window.h:55, from examples/corelib/tools/customtypesending/window.cpp:52: examples/corelib/tools/customtypesending/message.h:62:5: note: because ‘Message’ has user-provided ‘Message::Message(const Message&)’ 62 | Message(const Message &other); | ^~~~~~~ Change-Id: I563d53f7dd1e0e0dc5fd4db06299b2d0a70c62ff Reviewed-by: Edward Welbourne --- examples/corelib/tools/customtype/message.cpp | 15 --------------- examples/corelib/tools/customtype/message.h | 7 ++++--- examples/corelib/tools/customtypesending/message.cpp | 13 ------------- examples/corelib/tools/customtypesending/message.h | 7 ++++--- examples/corelib/tools/doc/src/customtype.qdoc | 5 ----- 5 files changed, 8 insertions(+), 39 deletions(-) diff --git a/examples/corelib/tools/customtype/message.cpp b/examples/corelib/tools/customtype/message.cpp index cc96aee978..e83697cb74 100644 --- a/examples/corelib/tools/customtype/message.cpp +++ b/examples/corelib/tools/customtype/message.cpp @@ -52,21 +52,6 @@ #include -//! [Message class implementation] -Message::Message() -{ -} - -Message::Message(const Message &other) - : m_body(other.m_body), m_headers(other.m_headers) -{ -} - -Message::~Message() -{ -} -//! [Message class implementation] - Message::Message(const QString &body, const QStringList &headers) : m_body(body), m_headers(headers) { diff --git a/examples/corelib/tools/customtype/message.h b/examples/corelib/tools/customtype/message.h index c1b8243237..bc30c45425 100644 --- a/examples/corelib/tools/customtype/message.h +++ b/examples/corelib/tools/customtype/message.h @@ -58,9 +58,10 @@ class Message { public: - Message(); - Message(const Message &other); - ~Message(); + Message() = default; + ~Message() = default; + Message(const Message &) = default; + Message &operator=(const Message &) = default; Message(const QString &body, const QStringList &headers); diff --git a/examples/corelib/tools/customtypesending/message.cpp b/examples/corelib/tools/customtypesending/message.cpp index 9386b93898..76f90e5144 100644 --- a/examples/corelib/tools/customtypesending/message.cpp +++ b/examples/corelib/tools/customtypesending/message.cpp @@ -50,19 +50,6 @@ #include "message.h" -Message::Message() -{ -} - -Message::Message(const Message &other) - : m_body(other.m_body), m_headers(other.m_headers) -{ -} - -Message::~Message() -{ -} - Message::Message(const QString &body, const QStringList &headers) : m_body(body), m_headers(headers) { diff --git a/examples/corelib/tools/customtypesending/message.h b/examples/corelib/tools/customtypesending/message.h index a93f111e45..38b5c8205f 100644 --- a/examples/corelib/tools/customtypesending/message.h +++ b/examples/corelib/tools/customtypesending/message.h @@ -58,9 +58,10 @@ class Message { public: - Message(); - Message(const Message &other); - ~Message(); + Message() = default; + ~Message() = default; + Message(const Message &) = default; + Message &operator=(const Message &) = default; Message(const QString &body, const QStringList &headers); diff --git a/examples/corelib/tools/doc/src/customtype.qdoc b/examples/corelib/tools/doc/src/customtype.qdoc index 7ccfc95c70..fb63bc539c 100644 --- a/examples/corelib/tools/doc/src/customtype.qdoc +++ b/examples/corelib/tools/doc/src/customtype.qdoc @@ -81,11 +81,6 @@ \section1 The Message Class Implementation - The implementation of the default constructor, copy constructor and destructor - are straightforward for the \c Message class: - - \snippet tools/customtype/message.cpp Message class implementation - The streaming operator is implemented in the following way: \snippet tools/customtype/message.cpp custom type streaming operator -- cgit v1.2.3 From 6132b77db9d180d7a86982b0ca2eeae202a72e55 Mon Sep 17 00:00:00 2001 From: Kavindra Palaraja Date: Tue, 29 Oct 2019 17:40:37 +0100 Subject: Doc: Clarify the ownership of a state for addState() Change-Id: Ibe498c5288faa478a4dba934bc3c403829b337db Fixes: QTBUG-62445 Reviewed-by: Ulf Hermann --- src/corelib/statemachine/qstatemachine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index a97700e5d0..44e4e151cb 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -2599,7 +2599,7 @@ void QStateMachine::setGlobalRestorePolicy(QState::RestorePolicy restorePolicy) /*! Adds the given \a state to this state machine. The state becomes a top-level - state. + state and the state machine takes ownership of the state. If the state is already in a different machine, it will first be removed from its old machine, and then added to this machine. -- cgit v1.2.3 From 41226c4c483aaad628cd1ae9733959d2a9389c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 28 Oct 2019 18:32:05 +0100 Subject: macOS: Don't skip display link delivery via GCD during live resizing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We now avoid flushing GL if the exposed size does not match the window size, so we don't need to halt update request delivery during resize. Change-Id: Iaa89e67d50c987757a586b5958e08edf71a5dd0c Reviewed-by: Morten Johan Sørvig Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoascreen.mm | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm index 40273bac84..bd5c95b9d0 100644 --- a/src/plugins/platforms/cocoa/qcocoascreen.mm +++ b/src/plugins/platforms/cocoa/qcocoascreen.mm @@ -375,15 +375,6 @@ void QCocoaScreen::deliverUpdateRequests() // it on the main thread yet, because the processing of the update request is taking // too long, or because the update request was deferred due to window live resizing. qDeferredDebug(screenUpdates) << ", " << framesAheadOfDelivery << " frame(s) ahead"; - - // We skip the frame completely if we're live-resizing, to not put any extra - // strain on the main thread runloop. Otherwise we assume we should push frames - // as fast as possible, and hopefully the callback will be delivered on the - // main thread just when the previous finished. - if (qt_apple_sharedApplication().keyWindow.inLiveResize) { - qDeferredDebug(screenUpdates) << "; waiting for main thread to catch up"; - return; - } } qDeferredDebug(screenUpdates) << "; signaling dispatch source"; -- cgit v1.2.3 From b20956531b9e3abb0f824480c5c90fc37f97abd3 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 31 Oct 2019 11:06:24 +0100 Subject: Doc: Remove empty section title from QMilankovicCalendar Change-Id: I01b311cbe67fbb89625beb5a3941a652c9e851ed Reviewed-by: Edward Welbourne --- src/corelib/time/qmilankoviccalendar.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/corelib/time/qmilankoviccalendar.cpp b/src/corelib/time/qmilankoviccalendar.cpp index 68d74947b9..673713a266 100644 --- a/src/corelib/time/qmilankoviccalendar.cpp +++ b/src/corelib/time/qmilankoviccalendar.cpp @@ -56,8 +56,6 @@ using namespace QRoundingDown; \brief The QMilankovicCalendar class provides Milanković calendar system implementation. - \section1 - The Revised Julian calendar, also known as the Milanković calendar, or, less formally, new calendar, is a calendar, developed and proposed by the Serbian scientist Milutin Milanković in 1923, which effectively discontinued -- cgit v1.2.3 From 09ee9ef65da985707f6e7bcc0e71ca680a8ea12b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 31 Oct 2019 14:20:37 +0100 Subject: Avoid EGL_BAD_MATCH in tst_qrhi autotest Call adjustedFormat() as advised by the docs: "Applications are advised to set this format on their QWindow in order to avoid potential BAD_MATCH failures." Task-number: QTBUG-79659 Change-Id: Ibf415fb0ee64bdd3f01d4ba744244bce811c0d27 Reviewed-by: Paul Olav Tvete --- tests/auto/gui/rhi/qrhi/tst_qrhi.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp index 768b227ecd..533d6b17b1 100644 --- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp +++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp @@ -1590,6 +1590,9 @@ void tst_QRhi::renderToWindowSimple() QScopedPointer window(new QWindow); switch (impl) { case QRhi::OpenGLES2: +#if QT_CONFIG(opengl) + window->setFormat(QRhiGles2InitParams::adjustedFormat()); +#endif Q_FALLTHROUGH(); case QRhi::D3D11: window->setSurfaceType(QSurface::OpenGLSurface); -- cgit v1.2.3 From c0adcf0f226e247c1f2f515cd33d7945573e96a5 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 16 Oct 2019 16:11:57 +0200 Subject: Fix text-rendering regression on semi-transparent background on Linux The short-cut for semi-transparent backgrounds has to take precedence over the disabled gamma-correction short-cut. The order got inversed in one function during 5.14 refactoring. Change-Id: I0e54428839428068b602a13eddbf69897ed0797d Reviewed-by: Eirik Aavitsland Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/painting/qdrawhelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index e5f752b94e..e8d129d047 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -6044,11 +6044,11 @@ static inline void alphargbblend_argb32(quint32 *dst, uint coverage, const QRgba // nothing } else if (coverage == 0xffffffff && qAlpha(src) == 255) { blend_pixel(*dst, src); - } else if (!colorProfile) { - *dst = rgbBlend(*dst, src, coverage); } else if (*dst < 0xff000000) { // Give up and do a naive gray alphablend. Needed to deal with ARGB32 and invalid ARGB32_premultiplied, see QTBUG-60571 blend_pixel(*dst, src, qRgbAvg(coverage)); + } else if (!colorProfile) { + *dst = rgbBlend(*dst, src, coverage); } else if (srcLinear.isOpaque()) { rgbBlendPixel(dst, coverage, srcLinear, colorProfile); } else { -- cgit v1.2.3 From 0ae489053a9fafeb45f6de4431ed7b7ea992b8f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 31 Oct 2019 14:29:11 +0100 Subject: Turn a local QHash into a QMultiHash 972a0402be4d7aed0ebbd0ff56b5018cda01599d was merged before one of its parent patches which changed this QHash into a QMultiHash. So in 5.14 it would overwrite values instead of adding new entries. No idea if it has caused or will cause any regressions. But it was an accident so let's fix it. Amends 972a0402be4d7aed0ebbd0ff56b5018cda01599d. Change-Id: I6623b0b7924024df148d5c83bcbb612f3e595f56 Reviewed-by: Lars Knoll --- src/widgets/widgets/qwidgettextcontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index dce18f9100..1c169c3325 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -2481,7 +2481,7 @@ void QWidgetTextControl::setExtraSelections(const QList hash; + QMultiHash hash; for (int i = 0; i < d->extraSelections.count(); ++i) { const QAbstractTextDocumentLayout::Selection &esel = d->extraSelections.at(i); hash.insert(esel.cursor.anchor(), i); -- cgit v1.2.3 From 37b4c07c705d068d00863ee0373322f8a94cb06e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 31 Oct 2019 13:49:57 +0100 Subject: 3rd-Party/Double conversion: Fix developer build with MSVC Re-apply 72e3d3633e4aca6742a124fb29584d46b63f40ff, which was omitted in 425df43d7fed19866fc7ceb3d26b6cc4190523f5. Task-number: QTBUG-79418 Change-Id: I0afa9ff9ace5bdc6cea103cf2acba6dbf9a64a72 Reviewed-by: Edward Welbourne --- src/3rdparty/double-conversion/double-conversion.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/3rdparty/double-conversion/double-conversion.cc b/src/3rdparty/double-conversion/double-conversion.cc index 9cf13bdbf7..8c52755cfb 100644 --- a/src/3rdparty/double-conversion/double-conversion.cc +++ b/src/3rdparty/double-conversion/double-conversion.cc @@ -38,6 +38,11 @@ #include #include +// Fix warning C4244: 'argument': conversion from 'const uc16' to 'char', possible loss of data +#ifdef _MSC_VER + __pragma(warning(disable: 4244)) +#endif + namespace double_conversion { const DoubleToStringConverter& DoubleToStringConverter::EcmaScriptConverter() { -- cgit v1.2.3