From c82d043de129ce3cb395b649cb8a7a20342c01fd Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Fri, 31 Aug 2018 10:11:09 +0200 Subject: [PATCH 01/14] Bump copyright year of code generated by dbus tools Change-Id: Ic5e2ecf672ea86e8ef70a9fa73c0535262d2e928 Reviewed-by: Friedemann Kleint Reviewed-by: Ulf Hermann --- src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp | 2 +- src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp index c76983200e..2115a14adf 100644 --- a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp +++ b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp @@ -62,7 +62,7 @@ static const char docTypeHeader[] = #define PROGRAMNAME "qdbuscpp2xml" #define PROGRAMVERSION "0.2" -#define PROGRAMCOPYRIGHT "Copyright (C) 2017 The Qt Company Ltd." +#define PROGRAMCOPYRIGHT "Copyright (C) 2018 The Qt Company Ltd." static QString outputFile; static int flags; diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp index bbe738dadb..5b76502c94 100644 --- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -46,7 +46,7 @@ #define PROGRAMNAME "qdbusxml2cpp" #define PROGRAMVERSION "0.8" -#define PROGRAMCOPYRIGHT "Copyright (C) 2017 The Qt Company Ltd." +#define PROGRAMCOPYRIGHT "Copyright (C) 2018 The Qt Company Ltd." #define ANNOTATION_NO_WAIT "org.freedesktop.DBus.Method.NoReply" From e0213d1939ac6f78e9e8b54d4e974fa32f75026a Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Tue, 20 Mar 2018 10:36:43 +0200 Subject: [PATCH 02/14] Android: Fix crash Android doesn't like nor use RTLD_NODELETE Tasnk-number: QTBUG-64654 Change-Id: I2d884bbf22a681cca592942eba84ba97327ba974 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/plugin/qlibrary_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index 851b9ff82f..e03814984c 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -157,7 +157,7 @@ bool QLibraryPrivate::load_sys() // Do not unload the library during dlclose(). Consequently, the // library's specific static variables are not reinitialized if the // library is reloaded with dlopen() at a later time. -#ifdef RTLD_NODELETE +#if defined(RTLD_NODELETE) && !defined(Q_OS_ANDROID) if (loadHints & QLibrary::PreventUnloadHint) { dlFlags |= RTLD_NODELETE; } From 5d0ee89132bd85d681d7b0840dcb5f01042237cc Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 28 Aug 2018 14:54:10 +0200 Subject: [PATCH 03/14] Fix reading 16bpc grayscale PNGs They were incorrectly attempted to be read as Indexed8, instead use the RGBA64 formats to read them with full accuracy. Task-number: QTBUG-45858 Change-Id: I14fc3cb0d59fa2fc0e68fd870f3b32352c34161f Reviewed-by: Eirik Aavitsland --- src/gui/image/qpnghandler.cpp | 37 ++++++++++-------- .../image/qimagereader/images/basn0g16.png | Bin 0 -> 167 bytes .../image/qimagereader/images/basn2c16.png | Bin 0 -> 302 bytes .../image/qimagereader/images/basn4a16.png | Bin 0 -> 2206 bytes .../image/qimagereader/images/basn6a16.png | Bin 0 -> 3435 bytes .../image/qimagereader/images/tbwn0g16.png | Bin 0 -> 1313 bytes .../image/qimagereader/tst_qimagereader.cpp | 5 +++ 7 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 tests/auto/gui/image/qimagereader/images/basn0g16.png create mode 100644 tests/auto/gui/image/qimagereader/images/basn2c16.png create mode 100644 tests/auto/gui/image/qimagereader/images/basn4a16.png create mode 100644 tests/auto/gui/image/qimagereader/images/basn6a16.png create mode 100644 tests/auto/gui/image/qimagereader/images/tbwn0g16.png diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index 94479b4f8e..242d8cd63b 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -245,7 +245,7 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal png_set_interlace_handling(png_ptr); if (color_type == PNG_COLOR_TYPE_GRAY) { - // Black & White or 8-bit grayscale + // Black & White or grayscale if (bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1) { png_set_invert_mono(png_ptr); png_read_update_info(png_ptr, info_ptr); @@ -266,19 +266,22 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal else if (g == 1) image.setColor(0, qRgba(255, 255, 255, 0)); } - } else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - png_set_expand(png_ptr); - png_set_strip_16(png_ptr); + } else if (bit_depth == 16) { + bool hasMask = png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS); + if (!hasMask) + png_set_filler(png_ptr, 0xffff, PNG_FILLER_AFTER); + else + png_set_expand(png_ptr); png_set_gray_to_rgb(png_ptr); - if (image.size() != QSize(width, height) || image.format() != QImage::Format_ARGB32) { - image = QImage(width, height, QImage::Format_ARGB32); + QImage::Format format = hasMask ? QImage::Format_RGBA64 : QImage::Format_RGBX64; + if (image.size() != QSize(width, height) || image.format() != format) { + image = QImage(width, height, format); if (image.isNull()) return; } - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) - png_set_swap_alpha(png_ptr); - png_read_update_info(png_ptr, info_ptr); + if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) + png_set_swap(png_ptr); } else if (bit_depth == 8 && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { png_set_expand(png_ptr); if (image.size() != QSize(width, height) || image.format() != QImage::Format_Grayscale8) { @@ -289,9 +292,7 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal png_read_update_info(png_ptr, info_ptr); } else { - if (bit_depth == 16) - png_set_strip_16(png_ptr); - else if (bit_depth < 8) + if (bit_depth < 8) png_set_packing(png_ptr); int ncols = bit_depth < 8 ? 1 << bit_depth : 256; png_read_update_info(png_ptr, info_ptr); @@ -356,12 +357,14 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) { png_set_bgr(png_ptr); } - } else if (bit_depth == 16 && (color_type & PNG_COLOR_MASK_COLOR)) { + } else if (bit_depth == 16 && !(color_type & PNG_COLOR_MASK_PALETTE)) { QImage::Format format = QImage::Format_RGBA64; if (!(color_type & PNG_COLOR_MASK_ALPHA) && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { png_set_filler(png_ptr, 0xffff, PNG_FILLER_AFTER); format = QImage::Format_RGBX64; } + if (!(color_type & PNG_COLOR_MASK_COLOR)) + png_set_gray_to_rgb(png_ptr); if (image.size() != QSize(width, height) || image.format() != format) { image = QImage(width, height, format); if (image.isNull()) @@ -680,11 +683,11 @@ QImage::Format QPngHandlerPrivate::readImageFormat() int num_palette; png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); if (color_type == PNG_COLOR_TYPE_GRAY) { - // Black & White or 8-bit grayscale + // Black & White or grayscale if (bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1) { format = QImage::Format_Mono; - } else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - format = QImage::Format_ARGB32; + } else if (bit_depth == 16) { + format = png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ? QImage::Format_RGBA64 : QImage::Format_RGBX64; } else if (bit_depth == 8 && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { format = QImage::Format_Grayscale8; } else { @@ -696,7 +699,7 @@ QImage::Format QPngHandlerPrivate::readImageFormat() { // 1-bit and 8-bit color format = bit_depth == 1 ? QImage::Format_Mono : QImage::Format_Indexed8; - } else if (bit_depth == 16 && (color_type & PNG_COLOR_MASK_COLOR)) { + } else if (bit_depth == 16 && !(color_type & PNG_COLOR_MASK_PALETTE)) { format = QImage::Format_RGBA64; if (!(color_type & PNG_COLOR_MASK_ALPHA) && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) format = QImage::Format_RGBX64; diff --git a/tests/auto/gui/image/qimagereader/images/basn0g16.png b/tests/auto/gui/image/qimagereader/images/basn0g16.png new file mode 100644 index 0000000000000000000000000000000000000000..318ebcadf4fd0b64fb9b824e81c0cc8e3dfd2d82 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^3Lq>1BpBEle`W(ImUKs7M+U~W1%@xC#RK_qo-U3d z9-UV&8FC#k;BgMLjDBB#?9PJ82Q;dUu4=I?zS(bY(Xf0+xUg{Y0;{G3S&o?ucbmRB zoML$)c8ASL&0+fj+X+UDyI8k3PT;(to58=tC&50S{f++@NsIIK3}QFDZ^ZA8J8=o* N0#8>zmvv4FO#l#XIHLdn literal 0 HcmV?d00001 diff --git a/tests/auto/gui/image/qimagereader/images/basn2c16.png b/tests/auto/gui/image/qimagereader/images/basn2c16.png new file mode 100644 index 0000000000000000000000000000000000000000..1bd4a4d0e2c2c6dd8a2e63a63b26f166b8ef5353 GIT binary patch literal 302 zcmV+}0nz@6P)NTxus~-YE?|ew94KIo9tHTv?hhRR zwrA%J^h9UxCeRmyPjW#d?oxNFL9(uFDZ1gBle+D$rIj`J+5;}Xa zfF63WfGT3xy1iYa$zve>zUQQss#Q*>R07*qoM6N<$g1`fR ASpWb4 literal 0 HcmV?d00001 diff --git a/tests/auto/gui/image/qimagereader/images/basn4a16.png b/tests/auto/gui/image/qimagereader/images/basn4a16.png new file mode 100644 index 0000000000000000000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Wv$E%vxUl`|`!e(G+og+_Uy_0jBw$w@Vv`WfKS07T1Ph9UIYq+fpnH!( z;D2j4rPeSn#&p)`Qj5U(Rr4MKU)UxPqX ztzk;7p<_#oYK2so@RX&V5M!xUMP3&^7LnOocI;h>?fN%Tz`#D~+=;_n9NcNR_n;7s zK<_CC-2h!vLX-smkV2q&9h#r2B=eN=^OCsQ(voQVt-L7Q&L?Hht!ZI9$joDt(z!bg z^OMk=0QYNHU4=*(%mVbj1IA4y#YrW_j;#XZ?^TR?UBZO(f>>&$BE~W@;n+h@D`@Wu z$+QV6z?hYpZ?mNH=7bd79)?B(Toc^9GNU(@8Kod-D+Jaj!40VlcSDlQ@=@{gQdwLr z{7&Zb}S~Y7L5w23`5q-r&J^mkTcViXI59GbI+3oJQLb^Xa=CM0~+5#BMC-O zA+UA{R^F8K>THn=w^)!Q^Kf1Hd0kwsr!Ly=Ul4@@*>gQCY&S<_=B_E7dnQy&=%m3* zDCd0zS}ADFD+E>zs2dWUs|O`O4x}A>>t~W=B5CF4X>qmStD@~)iUV3+_B@mqwwnc+ zd9xs$chb^OXB50E(5^x|39aW80`&^qb0xPgtMuBRkPK&4ggm`H%Fo9{P`Y=EwuAib zKPY=1x*=>g=Va#1fOOs&mBuk$A(S{Hf;FuuV#)d7sbeoV@Fcz z#`3Pp?K3L97A3<4ijriy)kU_eC)4|}U(UH||907*qoM6N<$f-(OD1poj5 literal 0 HcmV?d00001 diff --git a/tests/auto/gui/image/qimagereader/images/basn6a16.png b/tests/auto/gui/image/qimagereader/images/basn6a16.png new file mode 100644 index 0000000000000000000000000000000000000000..a9bf3cb461231de29905eaa02f3a8a66f9fc5477 GIT binary patch literal 3435 zcmZu!c{tPy7yiwHA^TDknhJAO5;JmTFJcJU8M34%B>R?S{LDp`Fk}h0vV{=c>|`0F zY}t2XhO#pw*@@4+-}ija_s93gIp?4AJnwVP`=0Zh6Lm*li-YYn8vpunKbAURdar&!F_@9SoS%FU_nL5v4bhxdo;qYV}(%9Z85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@pu5?I(QEIFDO9PIa zv;_;!pa1a#&4BOUPo0`ItE{ZJIBk{3V?$2;ETe5E7iFAugap!!JvpW;c(dAAQ8V< zZ&BY>NjD*)1qCrNK|y=>!VP%!s->l|vE8$;ud}nhz7j7eD@#re2?+@B@p<+PZorQp zO@$fmNmnXtCft}jxxc@;xf%mh0YPPDR#td8NVBJBWF$%~baiE3DVf#RJVAESq^VP< zPoFZSy}bqv6c$Ev8{HHsktow$V{lB`di z{%hX6Idl5@>guwxqN2jr>pYX5E|kJ^f&DqRx(f5PYbXXRS(0v=B3pVK=!U{clUf+^ zwk5aa8O@zLfBu36RaH?@k&$+SvH@a;con5$c|}DEZ2$iLjbgyIZE5`R>8TI9Qu-<< z%&Jo_i;I%V`!i?Gym|BImy|?C27OhSEj^vT%kqkchm?%||Dqzaq5gD9C*CIj-6lTnrHEYhC#6(Y5*#J=&#dFf1`ILEld3=?QfBAxDz@I+}XOr8) z_eUHoTv5Ut_PcOJ$k~z>P;}0k6%}PEBIC}VVH_mAk5_}&Lhw>xFqZ6`_b6dX!jw?c z%!-;Dfwv2)g69`EgOb#=Y2o48uO(Z#zd9_?))qGsnatzc{v3+|Jw5UA=}QBbWjreT z8u2D?TToHq>&cU+PVMgx3sZ_0b>T~KcQE76X3$TAY#mJXtlpDYGZ7 zBIi@!?b7Or6DLpZ>}crfArf4l~O;$zjSbkp>uelLq>cX#*pmXrhs+uBMi3p@E(ywgBe zjiXq Date: Fri, 31 Aug 2018 10:06:18 +0200 Subject: [PATCH 04/14] Android: Default to android-21 NDK for arm64-v8a The earlier NDK platforms do not support 64 bit architectures, so configure would fail with a confusing message about problems in the environment. [ChangeLog][Android] Default to android-21 for arm64 builds instead of failing. Task-number: QTBUG-70280 Change-Id: Ib9846d6deee3d453fd4a17a3ae92306482d380ba Reviewed-by: Simon Hausmann --- configure.pri | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.pri b/configure.pri index 805b985fa6..a8ef2c27d4 100644 --- a/configure.pri +++ b/configure.pri @@ -604,6 +604,9 @@ defineTest(qtConfOutput_prepareOptions) { target_arch = armeabi-v7a platform = $$eval(config.input.android-ndk-platform) + isEmpty(platform): equals(target_arch, arm64-v8a): \ + platform = android-21 + isEmpty(platform): \ platform = android-16 ### the windows configure disagrees ... From 179c88a1a99c4b035e0b195c5fea9b23e0d06479 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 27 Aug 2018 21:55:04 +0100 Subject: [PATCH 05/14] Rename QTimer::connectTo() to QTimer::callOnTimeout() Some people suggested the later, so let's have a second look at it before it's too late. Although I was in favor of the former I'm now having second thoughts. connectTo() is meant to only be used in classes which have a clear dominant signal, but there are rare classes that have two (example: QAbstractButton::toggled, QAbstractButton::clicked). QAbstractButton::connectTo() would be ambiguous if we ever wanted to add these shorthand connects to QtWidgets Change-Id: I198ad3326d31dcf89b9c47a299124572ee7b11b3 Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- src/corelib/kernel/qtimer.cpp | 10 +++++----- src/corelib/kernel/qtimer.h | 8 ++++---- tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index d8d520ff58..90f29aa630 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -571,7 +571,7 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv */ /*! - \fn template QMetaObject::Connection connectTo(Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template QMetaObject::Connection callOnTimeout(Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection) \since 5.12 \overload @@ -585,9 +585,9 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv */ /*! - \fn template QMetaObject::Connection connectTo(QObject *context, Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template QMetaObject::Connection callOnTimeout(QObject *context, Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection) \since 5.12 - \overload connectTo() + \overload callOnTimeout() Creates a connection from the timeout() signal to \a functor to be placed in a specific event loop of \a context, and returns a handle to the connection. @@ -599,9 +599,9 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv */ /*! - \fn template QMetaObject::Connection connectTo(QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template QMetaObject::Connection callOnTimeout(QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType connectionType = Qt::AutoConnection) \since 5.12 - \overload connectTo() + \overload callOnTimeout() Creates a connection from the timeout() signal to the \a method in the \a receiver object. Returns a handle to the connection. diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index f5c04c7f70..66f317c567 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -97,11 +97,11 @@ public: template static void singleShot(int msec, Qt::TimerType timerType, const QObject *context, Functor functor); template - QMetaObject::Connection connectTo(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); + QMetaObject::Connection callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); template - QMetaObject::Connection connectTo(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); + QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); template - QMetaObject::Connection connectTo(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection); + QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection); #else // singleShot to a QObject slot template @@ -160,7 +160,7 @@ public: } template - QMetaObject::Connection connectTo(Args && ...args) + QMetaObject::Connection callOnTimeout(Args && ...args) { return QObject::connect(this, &QTimer::timeout, std::forward(args)... ); } diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp index 927ba49f83..8d194dafc1 100644 --- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp +++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp @@ -75,7 +75,7 @@ private slots: void dontBlockEvents(); void postedEventsShouldNotStarveTimers(); - void connectTo(); + void callOnTimeout(); }; void tst_QTimer::zeroTimer() @@ -979,7 +979,7 @@ void tst_QTimer::crossThreadSingleShotToFunctor() delete o; } -void tst_QTimer::connectTo() +void tst_QTimer::callOnTimeout() { QTimer timer; QSignalSpy timeoutSpy(&timer, &QTimer::timeout); @@ -989,9 +989,9 @@ void tst_QTimer::connectTo() auto context = new QObject(); int count = 0; - timer.connectTo([&count] { count++; }); - QMetaObject::Connection connection = timer.connectTo(context, [&count] { count++; }); - timer.connectTo(&timer, &QTimer::stop); + timer.callOnTimeout([&count] { count++; }); + QMetaObject::Connection connection = timer.callOnTimeout(context, [&count] { count++; }); + timer.callOnTimeout(&timer, &QTimer::stop); QTest::qWait(100); From 5cc5b43d0f66ac05a2d31ac6557644769578e981 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 29 Aug 2018 10:59:24 +0200 Subject: [PATCH 06/14] Remove some misplaced sizeof() scalings on array sizes for new[] Noticed during review of clang-tidy warnings. I have searched the source tree (using grep) and only this one file contains examples of this mistake. Change-Id: I3bbcec736e5a184db7251962fd3671a21ab5d238 Reviewed-by: Friedemann Kleint Reviewed-by: Andy Shaw --- src/plugins/printsupport/windows/qwindowsprintdevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp index 071bc01192..f01e93d611 100644 --- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp +++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp @@ -210,7 +210,7 @@ void QWindowsPrintDevice::loadPageSizes() const && DeviceCapabilities((LPWSTR)m_id.utf16(), NULL, DC_PAPERS, NULL, NULL) == paperCount) { QScopedArrayPointer paperNames(new wchar_t[paperCount*64]); - QScopedArrayPointer winSizes(new POINT[paperCount*sizeof(POINT)]); + QScopedArrayPointer winSizes(new POINT[paperCount]); QScopedArrayPointer papers(new wchar_t[paperCount]); // Get the details and match the default paper size @@ -356,7 +356,7 @@ void QWindowsPrintDevice::loadInputSlots() const if (int(binCount) > 0 && DeviceCapabilities(printerId, nullptr, DC_BINNAMES, nullptr, nullptr) == binCount) { - QScopedArrayPointer bins(new WORD[binCount*sizeof(WORD)]); + QScopedArrayPointer bins(new WORD[binCount]); QScopedArrayPointer binNames(new wchar_t[binCount*24]); // Get the details and match the default paper size From 64fe66e7be9d30e523f766ee9822eba61f5014b3 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 30 Jul 2018 14:46:05 +0200 Subject: [PATCH 07/14] Add QString::compare(QStringView, CaseSensitivity) There was a QStringView::compare(QString, CaseSensitivity) but it's good that the symmetric also exists Change-Id: Ic789f11d41eb8cfa393cb51c19bd1f89bb87d912 Reviewed-by: Thiago Macieira --- src/corelib/tools/qstring.cpp | 13 +++++++++++++ src/corelib/tools/qstring.h | 9 ++++++++- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 5 +++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 6030d7058c..b3ed62982e 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6225,7 +6225,17 @@ QString& QString::fill(QChar ch, int size) sensitivity setting \a cs. */ +/*! + \fn int QString::compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const + \since 5.12 + \overload compare() + + Performs a comparison of this with \a s, using the case + sensitivity setting \a cs. +*/ + +#if QT_STRINGVIEW_LEVEL < 2 /*! \overload compare() \since 4.2 @@ -6241,6 +6251,7 @@ int QString::compare(const QString &other, Qt::CaseSensitivity cs) const Q_DECL_ { return qt_compare_strings(*this, other, cs); } +#endif /*! \internal @@ -6267,6 +6278,7 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_N return qt_compare_strings(*this, other, cs); } +#if QT_STRINGVIEW_LEVEL < 2 /*! \fn int QString::compare(const QStringRef &ref, Qt::CaseSensitivity cs = Qt::CaseSensitive) const \overload compare() @@ -6275,6 +6287,7 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_N an integer less than, equal to, or greater than zero if the string is less than, equal to, or greater than \a ref. */ +#endif /*! \internal diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index f18baf7065..6be3dcdbe1 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -608,8 +608,12 @@ public: QString &setUnicode(const QChar *unicode, int size); inline QString &setUtf16(const ushort *utf16, int size); +#if QT_STRINGVIEW_LEVEL < 2 int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; + inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; +#endif int compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; + inline int compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; static inline int compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW @@ -622,7 +626,6 @@ public: Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW { return -s2.compare(s1, cs); } - inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW; static int compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity = Qt::CaseSensitive) Q_DECL_NOTHROW; @@ -1638,8 +1641,12 @@ inline bool operator> (const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW inline bool operator<=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs >= lhs; } inline bool operator>=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs <= lhs; } +#if QT_STRINGVIEW_LEVEL < 2 inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW { return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); } +#endif +inline int QString::compare(QStringView s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW +{ return -s.compare(*this, cs); } inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW { return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); } inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index e6dfe81ca9..f429bda804 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -6238,11 +6238,14 @@ void tst_QString::compare() QStringRef r1(&s1, 0, s1.length()); QStringRef r2(&s2, 0, s2.length()); + const QStringView v2(s2); + QCOMPARE(sign(QString::compare(s1, s2)), csr); QCOMPARE(sign(QStringRef::compare(r1, r2)), csr); QCOMPARE(sign(s1.compare(s2)), csr); QCOMPARE(sign(s1.compare(r2)), csr); QCOMPARE(sign(r1.compare(r2)), csr); + QCOMPARE(sign(s1.compare(v2)), csr); QCOMPARE(sign(s1.compare(s2, Qt::CaseSensitive)), csr); QCOMPARE(sign(s1.compare(s2, Qt::CaseInsensitive)), cir); @@ -6250,6 +6253,8 @@ void tst_QString::compare() QCOMPARE(sign(s1.compare(r2, Qt::CaseInsensitive)), cir); QCOMPARE(sign(r1.compare(r2, Qt::CaseSensitive)), csr); QCOMPARE(sign(r1.compare(r2, Qt::CaseInsensitive)), cir); + QCOMPARE(sign(s1.compare(v2, Qt::CaseSensitive)), csr); + QCOMPARE(sign(s1.compare(v2, Qt::CaseInsensitive)), cir); QCOMPARE(sign(QString::compare(s1, s2, Qt::CaseSensitive)), csr); QCOMPARE(sign(QString::compare(s1, s2, Qt::CaseInsensitive)), cir); From 8b6100d512744563eeab8d926f883f8633fff45c Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 30 Jul 2018 14:47:17 +0200 Subject: [PATCH 08/14] QStringList: add contains(QStringView) overload Change-Id: I953e4ef3167011d0348ea482890e29478bd6f761 Reviewed-by: Thiago Macieira --- src/corelib/tools/qstringlist.cpp | 14 +++++++++++++- src/corelib/tools/qstringlist.h | 12 +++++++++++- .../corelib/tools/qstringlist/tst_qstringlist.cpp | 9 +++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index 712ba74716..c85a4f41dd 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -323,6 +323,7 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt: } +#if QT_STRINGVIEW_LEVEL < 2 /*! \fn bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const @@ -332,7 +333,18 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt: \sa indexOf(), lastIndexOf(), QString::contains() */ -bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str, +#endif + +/*! + \fn bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const + \overload + \since 5.12 + + Returns \c true if the list contains the string \a str; otherwise + returns \c false. The search is case insensitive if \a cs is + Qt::CaseInsensitive; the search is case sensitive by default. + */ +bool QtPrivate::QStringList_contains(const QStringList *that, QStringView str, Qt::CaseSensitivity cs) { return stringList_contains(*that, str, cs); diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h index e58445b8c0..b04b7c0bc8 100644 --- a/src/corelib/tools/qstringlist.h +++ b/src/corelib/tools/qstringlist.h @@ -117,8 +117,11 @@ public: { QList::operator=(std::move(other)); return *this; } #endif +#if QT_STRINGVIEW_LEVEL < 2 inline bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; +#endif inline bool contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + inline bool contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; inline QStringList operator+(const QStringList &other) const { QStringList n = *this; n += other; return n; } @@ -161,7 +164,7 @@ namespace QtPrivate { QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, const QString &str, Qt::CaseSensitivity cs); - bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs); + bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QStringView str, Qt::CaseSensitivity cs); bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QLatin1String str, Qt::CaseSensitivity cs); void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after, Qt::CaseSensitivity cs); @@ -213,16 +216,23 @@ inline QStringList QListSpecialMethods::filter(const QString &str, Qt:: return QtPrivate::QStringList_filter(self(), str, cs); } +#if QT_STRINGVIEW_LEVEL < 2 inline bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const { return QtPrivate::QStringList_contains(this, str, cs); } +#endif inline bool QStringList::contains(QLatin1String str, Qt::CaseSensitivity cs) const { return QtPrivate::QStringList_contains(this, str, cs); } +inline bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const +{ + return QtPrivate::QStringList_contains(this, str, cs); +} + inline QStringList &QListSpecialMethods::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs) { QtPrivate::QStringList_replaceInStrings(self(), before, after, cs); diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp index 9f054190e5..a3aec4c299 100644 --- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp +++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp @@ -273,6 +273,15 @@ void tst_QStringList::contains() QVERIFY(list.contains(QLatin1String("ARTHUR"), Qt::CaseInsensitive)); QVERIFY(list.contains(QLatin1String("dent"), Qt::CaseInsensitive)); QVERIFY(!list.contains(QLatin1String("hans"), Qt::CaseInsensitive)); + + QVERIFY(list.contains(QStringView(QString("arthur")))); + QVERIFY(!list.contains(QStringView(QString("ArthuR")))); + QVERIFY(!list.contains(QStringView(QString("Hans")))); + QVERIFY(list.contains(QStringView(QString("arthur")), Qt::CaseInsensitive)); + QVERIFY(list.contains(QStringView(QString("ArthuR")), Qt::CaseInsensitive)); + QVERIFY(list.contains(QStringView(QString("ARTHUR")), Qt::CaseInsensitive)); + QVERIFY(list.contains(QStringView(QString("dent")), Qt::CaseInsensitive)); + QVERIFY(!list.contains(QStringView(QString("hans")), Qt::CaseInsensitive)); } void tst_QStringList::removeDuplicates_data() From 92739691079e76fbceca1d730d8494c8e1a8105f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 31 Aug 2018 12:41:44 +0200 Subject: [PATCH 09/14] Allow passing custom arguments to qmlplugindump Add QMAKE_QMLPLUGINDUMP_FLAGS variable that allows plugins to set qmlplugindump options like -app, -noforceqtquick. The naming follows the example of e.g. QMAKE_LRELEASE_FLAGS. Task-number: QTBUG-70264 Change-Id: I1d11b7f3b03fab79ab9e06188cecf31650789302 Reviewed-by: Christian Kandeler --- mkspecs/features/qml_plugin.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf index d49f4c49c1..0786dbfd84 100644 --- a/mkspecs/features/qml_plugin.prf +++ b/mkspecs/features/qml_plugin.prf @@ -111,7 +111,7 @@ load(qt_common) load(resolve_target) TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, ) qmltypes.target = qmltypes - qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE + qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$QMAKE_QMLPLUGINDUMP_FLAGS $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE qmltypes.depends = $$QMAKE_RESOLVED_TARGET } else { qmltypes.CONFIG += recursive From fe463dd4228c42d93ffd0a26cb31281b230a8e52 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Fri, 24 Aug 2018 20:53:23 +0200 Subject: [PATCH 10/14] QSFPM: cleanup QRegularExpression includes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add feature guard around the include in the header and remove the one from the implementation file. Change-Id: I8dc133cce786ead6059cc66b40a0ffb6c420096f Reviewed-by: MÃ¥rten Nordheim --- src/corelib/itemmodels/qsortfilterproxymodel.cpp | 1 - src/corelib/itemmodels/qsortfilterproxymodel.h | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 6b59b0723b..31b9bbc990 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h index 0b7c69f37d..1304a95d13 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.h +++ b/src/corelib/itemmodels/qsortfilterproxymodel.h @@ -42,7 +42,10 @@ #include #include -#include + +#if QT_CONFIG(regularexpression) +# include +#endif QT_REQUIRE_CONFIG(sortfilterproxymodel); @@ -87,8 +90,10 @@ public: QRegExp filterRegExp() const; void setFilterRegExp(const QRegExp ®Exp); +#if QT_CONFIG(regularexpression) QRegularExpression filterRegularExpression() const; void setFilterRegularExpression(const QRegularExpression ®ularExpression); +#endif int filterKeyColumn() const; void setFilterKeyColumn(int column); From 69a2bc7a2a9ab7192024f93df3af9d07b15ebcf1 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 29 Aug 2018 11:52:18 +0200 Subject: [PATCH 11/14] Doc: Explicitly state that QSqlTableModel only handles EditRole Fixes: 5.12.0 Task-number: QTBUG-70234 Change-Id: I65c6aa60048182c5408dca2aa20098af363b10ec Reviewed-by: Christian Ehrlicher Reviewed-by: Venugopal Shivashankar --- src/sql/models/qsqltablemodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 865f76c73a..a33f76838f 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -565,6 +565,10 @@ bool QSqlTableModel::isDirty(const QModelIndex &index) const Returns \c true if the value could be set or false on error, for example if \a index is out of bounds. + Returns \c false if the role is not Qt::EditRole. To set data + for roles other than EditRole, either use a custom proxy model + or subclass QSqlTableModel. + \sa editStrategy(), data(), submit(), submitAll(), revertRow() */ bool QSqlTableModel::setData(const QModelIndex &index, const QVariant &value, int role) From a3ee0b94daa5840590dc8b9b546d997d0823b55f Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 27 Aug 2018 13:08:53 +0200 Subject: [PATCH 12/14] QWindowsStyle: respect rectangle when drawing PE_IndicatorViewItemCheck This is a follow-up on commit 6553921dd537e416da2f4d1441ab6d63059cda60, which fixed the drawing of the surrounding rectangle when used in item views. This one now fixes the drawing of the check mark itself, for both item views and standalone items. Change-Id: I14f359e9d2ef33652cc68494b7d114e61110e5e0 Reviewed-by: Andre de la Rocha Reviewed-by: Friedemann Kleint --- src/widgets/styles/qwindowsstyle.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index d4ccd0931e..611de6991f 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -845,12 +845,14 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, #endif // QT_CONFIG(itemviews) if (!(opt->state & State_Off)) { QPointF points[6]; - points[0] = { opt->rect.x() + QStyleHelper::dpiScaled(3.5), opt->rect.y() + QStyleHelper::dpiScaled(5.5) }; - points[1] = { points[0].x(), points[0].y() + QStyleHelper::dpiScaled(2) }; - points[2] = { points[1].x() + QStyleHelper::dpiScaled(2), points[1].y() + QStyleHelper::dpiScaled(2) }; - points[3] = { points[2].x() + QStyleHelper::dpiScaled(4), points[2].y() - QStyleHelper::dpiScaled(4) }; - points[4] = { points[3].x(), points[3].y() - QStyleHelper::dpiScaled(2) }; - points[5] = { points[4].x() - QStyleHelper::dpiScaled(4), points[4].y() + QStyleHelper::dpiScaled(4) }; + qreal scaleh = opt->rect.width() / 12.0; + qreal scalev = opt->rect.height() / 12.0; + points[0] = { opt->rect.x() + 3.5 * scaleh, opt->rect.y() + 5.5 * scalev }; + points[1] = { points[0].x(), points[0].y() + 2 * scalev }; + points[2] = { points[1].x() + 2 * scaleh, points[1].y() + 2 * scalev }; + points[3] = { points[2].x() + 4 * scaleh, points[2].y() - 4 * scalev }; + points[4] = { points[3].x(), points[3].y() - 2 * scalev }; + points[5] = { points[4].x() - 4 * scaleh, points[4].y() + 4 * scalev }; p->setPen(QPen(opt->palette.text().color(), 0)); p->setBrush(opt->palette.text().color()); p->drawPolygon(points, 6); From 42a68ee9dd53eac2d8aaabf02dcf4ffa4525facf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 3 Sep 2018 15:36:59 +0200 Subject: [PATCH 13/14] Fix precompiled header detection for clang-cl Do not unconditionally enable precompiled headers for MSVC since clang-cl does not support it. Task-number: QTBUG-63512 Change-Id: I95df7d3bb51647ecee8ddc3161421768313ab4a1 Reviewed-by: Simon Hausmann --- configure.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.json b/configure.json index 8c8118f39a..03b1353e5b 100644 --- a/configure.json +++ b/configure.json @@ -844,7 +844,7 @@ }, "precompile_header": { "label": "Using precompiled headers", - "condition": "config.msvc || tests.precompile_header", + "condition": "tests.precompile_header", "output": [ "privateConfig", { "type": "varRemove", "negative": true, "name": "CONFIG", "value": "'precompile_header'" } From 028727c20ca43f1a56bad010354837e238e30024 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 30 Aug 2018 15:27:17 +0200 Subject: [PATCH 14/14] ASAN: Disable SSE4.1 code in qstricmp because of heap-buffer-overflow Although it is safe to slightly overread a string (provided it doesn't cross page boundaries), ASAN is extremely picky about this kind of behavior. So, do not run with this vectorized code when ASAN is enabled. Task-number: QTBUG-70269 Change-Id: I2b59b524d608afec8985227285feab55158d7247 Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Thiago Macieira --- src/corelib/tools/qbytearray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 10e9b22161..b53a60b9bf 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -432,7 +432,7 @@ int qstricmp(const char *str1, const char *str2) return int(Incomplete); }; -#ifdef __SSE4_1__ +#if defined(__SSE4_1__) && !(defined(__SANITIZE_ADDRESS__) || QT_HAS_FEATURE(address_sanitizer)) enum { PageSize = 4096, PageMask = PageSize - 1 }; const __m128i zero = _mm_setzero_si128(); forever {