summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Revert "QCryptographicHash: make SHA3 calculate SHA3, not Keccak"Thiago Macieira2017-08-311-40/+12
| | | | | | | | | | | | | This reverts commit a647004d9f349e0edc4254dcfe672ccf18f98ea7 (which is a backport of 88a8feeacb9bdaff9ee06164424e407eb904cd10). After the 5.9.0 release, we've found that changing the algorithm is a bad idea. It's true that Qt hasn't calculated SHA-3, but it's calculated something and people may be using it. Keeping a consistent calculation is better for the 5.6 LTS. Discussed-on: http://lists.qt-project.org/pipermail/development/2017-August/030786.html Change-Id: I38341f8155354cc4a776fffd14dfdbcdc7d0f039 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix huge painting artefact of certain dashed linesEirik Aavitsland2017-08-221-1/+1
| | | | | | | | | | | | | | | | The artefacts appeared for square-capped dashed pens when the end of the line fell a tiny fraction into the start of a new dash. At that point in the dashing algorithm, accumulated precision errors in the 'length' variable could make it slightly differ from the actual length between the start and end points of the line fragment. Although both values would be "almost zero", the rasterizeLine() function's square capping would make the error very visible; see the bug report. Fix by calculating the precise length of the last line fragment. Task-number: QTBUG-56969 Change-Id: I7b69c0d465649be61fb87ac7b8348f0c299486ee Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 73573fce295caef35da706a8c8c796ec18e6baf1)
* Fix write and read-write ioctls on certain 64-bit OSThiago Macieira2017-08-141-1/+1
| | | | | | | | | | | | | | | Using int as the operation parameter was wrong. It meant any write or RW ioctls (which have the MSB set) would be sign-extended to 64-bit when calling the native API. Depending on the OS, the upper 32 bits were not cleared prior to comparing with the call number, resulting in unexpected errors. Linux and FreeBSD operated properly; I only got the error on Darwin. Change-Id: Iaf4157b7efa2416d898cfffd14d985af65c1ff89 Reviewed-by: Jake Petroules <jake.petroules@qt.io> (cherry picked from commit feb24153633859502f30bc16b149c78fb1d651b7) Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Bump minimum glibc requirement for sys/eventfd.h to glibc 2.8Thiago Macieira2017-08-051-2/+4
| | | | | | | | | | | | | | | | | The file was added to glibc 2.7 along with the functions we need (Added 2007-10-05). But they forgot to install the file until a month and a half later (2007-11-17), which means it missed the 2.7 release (2007-10-19). Note that EFD_CLOEXEC wasn't added until glibc 2.9, so effectively glibc 2.9 is required. Change-Id: I3868166e5efc45538544fffd14d773ba576fb793 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> (cherry picked from commit b22b5141404fe943e64ea7dad094097e8a0fd77d) Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use correct DRM event context versionJonathan Liu2017-07-281-1/+1
| | | | | | | | | | | | | | | Explicitly declare which DRM event context version we want to use, rather than just the latest one libdrm supports. New versions may change semantics, or extend the structure, in ways we're unaware of. Stick with version 2, which is the version that introduced page_flip_handler. Change-Id: I1d2066d5ab485ea571f016a8660829f435821c82 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 50275fbcaf60ed41bd4486f8239cc7914c8af0f5)
* Use pkg-config for libdrm in eglfs_kms_egldevice backend if possibleJonathan Liu2017-07-191-1/+6
| | | | | | | | | | | | Without pkg-config, /usr/include/libdrm is not added to the include search path so xf86drm.h may be unable to include drm.h. This change is being applied directly to 5.6 because it's not applicable to 5.9 or dev. Those versions of Qt have moved to using QMAKE_USE which will already use pkg-config if available. Change-Id: I875c1e5f1b3cce63fd6b529d9d8ac97fd5bb56e8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* macOS: Don't keep WA_MacAlwaysShowToolWindow windows always on topTor Arne Vestbø2017-06-302-5/+84
| | | | | | | | | | | | | | | | | | | | | | | | | On macOS if an application is no longer active then it will cause any tool windows to hide until the application is active again. For applications that did not want this behavior and thus wanted the tool window to stay visible, the WA_MacAlwaysShowToolWindow flag is available. In order to ensure that this flag is respected, the tool window needs to have its level changed when the application active status changes. Once it is no longer active the window needs to be seen as a normal window, and when it is active then it needs to be set to be a window that is always on top to get the right behavior. Due to various bugs in AppKit we need to explicitly order windows in front during this process, which requires us to then iterate the windows in back-to-front order. For macOS versions < 10.12 there is no way to get an ordered list of windows, so we fall back to using the window creation order. Task-number: QTBUG-57581 Change-Id: If20b4698616707685f83b1378f87593f8169c8c6 (cherry picked from commit 4c346b6e2bfab976bc9b16275b8382aee38aefa4) Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Teach QTestLib to read QTEST_ENVIRONMENT to expand blacklist keywordsTor Arne Vestbø2017-06-211-1/+8
| | | | | | | | | | | | Can be used by CI system to set QTEST_ENVIRONMENT="ci", allowing test to be blacklisted only for the CI. Task-number: QTBUG-59564 Change-Id: I7088abb888c179bafc621f11191efbc45c37b179 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 6d49311a5da483190136209dc902969d1ef4a217) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Restore binary compatibility with pre-5.6 qt_handleMouseEventJan Kundrát2017-06-191-0/+6
| | | | | | | | | | | | | | | | | | | An internal, private symbol was changed in beef975f92e42143c464d68afa6b8cd4f7ef7389. However, this symbol was being used by some inline functions in QtTest, and this therefore introduced a BIC. This change simple adds back a symbol with the original signature. I recall seeing this in my own work, and the KDE CI system hits this as well: libKF5KDELibs4Support.so.5.25.0: undefined reference to `qt_handleMouseEvent(QWindow*, QPointF const&, QPointF const&, QFlags<Qt::MouseButton>, QFlags<Qt::KeyboardModifier>)' Task-number: QTBUG-52205 Change-Id: I4e85996850cc436b6a31addca3a8f9829c0c5edd (cherry picked from commit 7f12f94e481d4908ee7b68e2cab8263b7476b054) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix namespaced build using harfbuzz-ngThiago Macieira2017-06-161-0/+3
| | | | | | | | | | | | harfbuzz-ng doesn't link to Qt libraries, but uses the Qt headers for some types. With CONFIG -= qt, we don't get QT_NAMESPACE set, which leads to linker errors later. Instead of setting QT_NAMESPACE, ask qversiontagging.h not to tag the headers. Change-Id: Ie585843cfb684bc3b6e3fffd145e7e438ae7c6bd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> (cherry picked from commit 091e61b3525c700ce4198086bbd0d95a59fcb31f) Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix crash when calling QWidget::grab() on a QOpenGLWidgetSérgio Martins2017-06-081-2/+4
| | | | | | | | | | | | | | | By avoiding unneeded nested QPainters. Crash was: ASSERT: "s" in file /data/sources/qt/qt5/qtbase/src/gui/painting/qpaintengine_raster.cpp, line 2239 s was nullptr because the inner QPainter had called updateState(0), which is then dereferenced by the outer QPainter. Task-number: QTBUG-61036 Change-Id: I7aad648f805f1abac4d38dfbefa2292da8b52af4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 0265a23bb02b68534bb3c86514cc93bc45a7444f)
* Translate the adjusted deviceWindowRect with an adjusted offsetAllan Sandfeld Jensen2017-06-081-1/+7
| | | | | | | | | | Otherwise the mismatched device pixel ratio will lead to incorrectly offset blitting. Task-number: QTBUG-59017 Change-Id: Iccbe9cd9704bccbceda4c8dafe87435b68b5cf3e (cherry picked from commit dd8313d5be4fe4dd0defdf3eb78e2b47f0e2f20e) Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* define QT_NO_EXCEPTIONS reliably when using ClangR.J.V. Bertin2017-06-052-1/+16
| | | | | | | | | | | | | Clang's definition of the __EXCEPTIONS macro is inconsistent across platforms. When compiling for Darwin, Clang 3.6 and newer will set the token when exceptions are enabled in either C++ or ObjC. This change adds the reliable check described in the Clang 3.6 release notes to ensure that QT_NO_EXCEPTIONS is defined when required. Task-number: QTBUG-61034 Change-Id: I8205793c1501a4243b14d8642fe1f16d2df69be4 (cherry picked from commit 6e97d091e4d30566c14cf726f44d9e17f819c2c2) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* HiDPI: Scale mouse position on enter eventBłażej Szczygieł2017-05-221-1/+2
| | | | | | | Task-number: QTBUG-60892 Change-Id: If800ecaadc5b19c10a954658ece484f30b7f313f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 53335315ff11752dc0f731adb1c2d5a0f6281b25)
* Remove some more register keywordsMarc Mutz2017-05-091-2/+2
| | | | | | | | They're deprecated since C++11 and removed in C++17. Change-Id: Ia2acd9312707bfee96838743645a04ae1780e5dd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b92267cd4c4a7c88aab950ad519943d85add1da2)
* QHash/QMultiHash: fix operator==Giuseppe D'Angelo2017-05-092-10/+49
| | | | | | | | | | | | | The existing QHash::operator== does not work when the same keys appear in different order between the two hashes being compared. However, relying on iteration order on a QHash is (as usual) a bad idea and one should never do it. Task-number: QTBUG-60395 Change-Id: Ifb39a6779230e26bbd6fdba82ccc0247b9cdc6ed Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit dbd55cdaf367bdc9d6774bcb9927cbe19f18065f) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* ANGLE: Improve error handlingOliver Wolff2017-05-057-55/+477
| | | | | | | | | | This patch backports ab4fd98fac0cbc30cfc578a06c068519ee2df2e1 from ANGLE proper. It greatly improves error handling in important places and thus avoids crashes. Task-number: QTBUG-48970 Change-Id: Idcdc54396731323ebf4587b73b3360d5f3d17506 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QOpenGLWidget: Fix UB (invalid cast) in ~QOpenGLWidgetPrivateDyami Caliri2017-05-051-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QOpenGLWidgetPrivate destructor calls reset(), which accesses the Q-pointer. Calling Q_Q(Class) while still inside the private class's destructor is wrong due to the cast in q_func() which is undefined behavior at that stage. Here is the UB report: qopenglwidget.cpp:548:5: runtime error: downcast of address 0x000016d0e200 which does not point to an object of type 'QOpenGLWidget' 0x000016d0e200: note: object is of type 'QObject' 00 00 00 00 10 30 32 0f 00 00 00 00 40 e2 d0 16 00 00 00 00 80 7b 42 0f 00 00 00 00 00 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QObject' 0 QOpenGLWidgetPrivate::reset qopenglwidget.cpp 656 0x607e667 1 QOpenGLWidgetPrivate::~QOpenGLWidgetPrivate qopenglwidget.cpp 570 0x60982ab 2 QOpenGLWidgetPrivate::~QOpenGLWidgetPrivate qopenglwidget.cpp 569 0x6098516 3 QScopedPointerDeleter<QObjectData>::cleanup qscopedpointer.h 54 0xcbf7058 4 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer qscopedpointer.h 101 0xcbde858 5 QObject::~QObject qobject.cpp 1042 0xcb94792 6 QWidget::~QWidget qwidget.cpp 1701 0x5e173f7 7 QOpenGLWidget::~QOpenGLWidget qopenglwidget.cpp 946 0x608d72b 8 ImagePreviewComponent::~ImagePreviewComponent imagepreviewcomponent.h 16 0x58237b6 9 ImagePreviewComponent::~ImagePreviewComponent imagepreviewcomponent.h 16 0x58238c6 Change-Id: If13932ac657afb9d1358ac82ab911a05e96cfbcd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 32f8cbae90d7d5f5a23a645b39a2f1a29d378af8)
* QUrl: fix IDN conversion when the ACE form is invalidThiago Macieira2017-05-041-9/+36
| | | | | | | | | | | | | | | | | We guarded against the Unicode form being invalid and did not produce an encoded form. But we did not guard against proper Punycode sequences that decode to forms that had not passed the proper Nameprep stage. So check for that and, if it fails, just keep the label in the form we found it in (it's valid STD3 anyway). [ChangeLog][QtCore][QUrl] Fixed a bug that caused certain domain names that look like Internationalized Domain Names to become corrupt in decoded forms of QUrl, notably toString() and toDisplayString(). Task-number: QTBUG-60364 Change-Id: Iadfecb6f28984634979dfffd14b833142cca8d0d Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 9e2c6899e0a07edf525945a182d2537086441268)
* QUrl: fix IDN whitelist checking when the TLD is in UnicodeThiago Macieira2017-05-041-2/+2
| | | | | | | | | | | The whitelist is kept in ACE form, so if the TLD came in Unicode, we need to run ToASCII before we can check the whitelist. This is slightly inefficient because we'll run the same operation later in this domain. Change-Id: Iadfecb6f28984634979dfffd14b831f37b0f4818 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org> (cherry picked from commit 21dd5d314a75c09250448e5d59dfb9af88c0f7d5)
* [doc] QSet: fix return type of insert()Marc Mutz2017-05-041-1/+1
| | | | | | | | | It's an iterator, not a const_iterator. Let QDoc figure out the correct one. Change-Id: I7ddd1568adbf811b801c170794465ba14ceed05e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 47cf309190a3cc833f935397fc0db7cfbcddbc44) Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Use gdbserver command from a safe placeBogDan Vatra2017-05-021-42/+11
| | | | | | | | | Removed support for old QtCreator versions (pre 3.5) Change-Id: I5ec0e965c09c8a76810144b133af3395e32fddfa Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit c76918b2b21c25d927dca8f8911349a15f22a1e2)
* Improve QStringBuilder docsMarc Mutz2017-04-181-8/+20
| | | | | | | | | | | - Mention you can build QByteArrays, too - Nicer list of types that can be used, separate for QByteArray and QString Change-Id: Ia91445f0cb4872bab12a55f4812c283e9c38dba4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> (cherry picked from commit 11ed95ac9c12ee2b20b5c6f6be68d0b6387c0e70)
* Fix build with libdrm >= 2.4.78Thiago Macieira2017-04-181-5/+5
| | | | | | | | | | | drmEventContext has grown by one pointer, so the build fails with an error about a member without initialization. qeglfskmsgbmdevice.cpp:147:5: error: missing initializer for member ‘_drmEventContext::page_flip_handler2’ [-Werror=missing-field-initializers] Change-Id: I0e1a09998253489388abfffd14b6014b1ddc90e1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 34d2fd14979198dc0fcc07f73581ece9540c4b72)
* QVariant: fix docs regarding QUuidMarc Mutz2017-04-141-3/+5
| | | | | | | | | - toUuid(): QUuid is a built-in type, so use type(), not userType() - canConvert()/toUuid(): QUuid converts to and from QString Change-Id: I5262ff7ab093040cb943b6ab9cfffe95491d2b9b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9d1203bf02abec8b5ab73c4c8a81eb4627336ad8)
* QMatrix4x4: fix aliasing problem in operator*=Marc Mutz2017-04-141-1/+2
| | | | | | | | | | | | When multiplying a QMatrix4x4 by itself, we were clobbering the very matrix we read from. Employ read-caching to avoid this aliasing problem. [ChangeLog][QtGui][QMatrix4x4] operator*=() now calculates the correct result even if the RHS and LHS are the same object. Change-Id: I8534d56cfdd62c336577125127f05173fcec2873 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> (cherry picked from commit 5662234afaf23d88e1f3fa4bee2a59b61bd0c267)
* Cocoa: Unbreak app activation on macOS SierraMorten Johan Sørvig2017-04-122-10/+18
| | | | | | | | | | | | | | | | | | Previously, we would activate the application during QCocoaIntegration construction, which means at QApplication creation time. This now seems to interfere with application startup on macOS Sierra, where the application window ends up in an unfocused state. Move application activation to applicationDidFinishLaunching, at which point the Cocoa runtime should be completely initialized. Do this for 10.12+ only to avoid regressions/ test failures on previous versions. Task-number: QTBUG-57044 Change-Id: If6248753236d7473db2b8513dba0368901f3f4cf (cherry picked from commit 2c9dc93696f32b798b872f931c102329d0ba7155) Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Android: Fix crash at exitBogDan Vatra2017-04-112-14/+16
| | | | | | | | | | | | We need to remove and release the surface imediately, otherwise setSurface might be called after the object is deleted. Task-number: QTBUG-59818 Change-Id: I3a09e3de1ceecc22d8d7a48e2fc1cfe40cf09f0a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Mathias Hasselmann <mathias.hasselmann@kdab.com> Reviewed-by: Christian Stromme <christian.stromme@qt.io> (cherry picked from commit 6c4cbd4122edf8b78f34778400d485b11da98404)
* QMap: fix UB (invalid cast) in QMapData::end()Thiago Macieira2017-04-111-2/+4
| | | | | | | | | | | | | | | | | | The end() pointer, like in all other containers, is a sentinel value that must never be dereferenced. But unlike array-based containers, end() in QMap is not "last element plus one", but points to a base class of Node, not a full Node. Therefore, the casting from QMapNodeBase to QMapNode must not be a static_cast, reinterpret_cast is required. libstdc++-v3's red-black tree had the exact same problem: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60734 Change-Id: I43f05fedf0b44314a2dafffd14b33697861ae589 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> (cherry picked from commit 75cdf654bcc192ba73a8834e507583a59140e7e4) Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QtWidgets: Fix white text color on tabs on macOS for non-macOS stylesBłażej Szczygieł2017-04-111-3/+2
| | | | | | | | | | | | Apply white text only for macOS style. Amends 2c0033983bc53e906eab3f4b2fae836ff8472713 Task-number: QTBUG-59784 Change-Id: I9e66e929699efd715ed4565394f1aba763aeb32a Reviewed-by: Jake Petroules <jake.petroules@qt.io> (cherry picked from commit 2fbc1432025dd478cf9e940e3c2a1952b218c6dc) Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* doc: fix variable name in QDBusArgument::beginMap() exampleRolf Eike Beer2017-04-101-1/+1
| | | | | Change-Id: I77731a4c8479a4db46b981993d72f28eb19f7594 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add gradle wrapper to Qt & update default Andriod gradle pluginBogDan Vatra2017-04-109-2/+1268
| | | | | | | | | | We need to add gradle wrapper to Qt because it was removed from latest Android SDK. Adding it to Qt, will give us more control and will save us from pain in the future. Task-number: QTBUG-59237 Change-Id: I6419876f8be11c0feeac448b228a46f811065264 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 12a0e1b4f8c0e66b373b11b83956d1fa292c7ac4)
* Fix menu position when highdpi scalingMorten Johan Sørvig2017-04-071-2/+3
| | | | | | | | | | | | | | | | | | | Certain display and scale factor configurations would cause menus to pop up in incorrect locations or not be shown at all. This was due to QDesktopWidget::screenNumber() having a toNativePixels(QRect, QWindow) call which requires that QWindow::screen() returns the correct screen. Break the circular dependency by converting coordinates the other way for the intersection test: transform screen geometry to device independent coordinates. Task-number: QTBUG-58329 Change-Id: I5ff2a5b14296ddbf7d8ddca11420988aae6cc0bd (cherry picked from commit 5e76cb16924a42cb020786f45cc3494dd5836c5c) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QCryptographicHash: make SHA3 calculate SHA3, not KeccakGiuseppe D'Angelo2017-03-311-12/+40
| | | | | | | | | | | | | | | | | | | | The SHA3 family is a modified version of Keccak. We were incorrectly calculating Keccak (and even *testing* Keccak!), but claiming it was SHA3. To actually calculate SHA3, we need invoke Keccak on the original message followed by the two bits sequence 0b01, cf. §6.1 [1]. [1] http://dx.doi.org/10.6028/NIST.FIPS.202 [ChangeLog][QtCore][QCryptographicHash] QCryptographicHash now properly calculates SHA3 message digests. Before, when asked to calculate a SHA3 digest, it calculated a Keccak digest instead. Task-number: QTBUG-59770 Change-Id: Iae694d1a1668aa676922e3e00a292cddc30d3e0d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 88a8feeacb9bdaff9ee06164424e407eb904cd10)
* QCryptographicHash: fix documentation of the supported algorithmsGiuseppe D'Angelo2017-03-311-1/+2
| | | | | | Change-Id: Idfa7843ef8a8e3410ae0a8cf5311b8b598299730 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit cd9e850f9e9620a8bafec964efad8098443be7f1)
* Fix floating dock widget having the wrong parentOlivier Goffart2017-03-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When dragging out a tabbed group which contains placeholder for floating QDockWidget, the floating QDockWidget would not be reparented to the new QDockWidgetGroupWindow. That's because QDockAreaLayoutInfo::reparentWidgets does not reparent floating widget (because of the item.skip test) However, we need to be careful when reparenting to pass the flags so it does not get docked. Also do not reparent QDockWidgetGroupWindow which may end up temporarily in the layout during animation when dragging a QDockWidgetGroupWindow onto another. Step to reproduce a crash that if fixed by this patch (with the mainwindow example): 1. Enable QMainWindow::GroupedDragging from the "Main window" menu 2. Add a new dock widget, "Foo", from the "Dock Widgets" 3. Tab "Foo" together with the black dock widget 4. Drag "Foo" out. (Now, Foo is still a child of the QMainWindow, and is still in the layout as tabbed, but is skipped) 5. Drag the black dockwidget out. (This, in fact, crates a QDockWidgetGroupWindow which contains the black dockwidget and the floating "Foo", but since "Foo" is floating, it is not reparented) 6. Destroy "Foo" using the "Dock Widgets" menu. (Since Foo's parent is the QMainWindow, it is not removed from the QDockWidgetGroupWindow's layout, which will cause crash on the next relayout)" This commits amends commits d57bb19902f863fc6db07674f6bd8881b0886b39 and 0feeb6f6d2cfaa964763ca1fcab65672812b4eef Change-Id: I600a56cdd889435b83d2b740598a24d81059bf44 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> (cherry picked from commit ee84af00d1ad28138a66ac422b1edb7be896512b)
* Fix crash in QWindowPrivate::applyCursor when screen is nullOlivier Goffart2017-03-272-8/+11
| | | | | | | | | | | | | | QWindow::setVisible calls QWindowPrivate::applyCursor without checking if screen() returns null. This patch adds a check in QWindowPrivate::applyCursor that the screen is not null. Now that it is tested there, no need to test it from the other caller (setCursor) This patch should not change behavior of setCursor at all, it should only fix the crash when coming from setVisible Task-number: QTBUG-59528 Change-Id: I06bbdb4e04c02ac840ba637242d1f2cfde5bdd62 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 5cda0172e0eb912ef4814f3c5618686cbb1a5da1)
* Bump copyright yearFriedemann Kleint2017-03-271-1/+1
| | | | | | | Task-number: QTBUG-59648 Change-Id: Ie2d08515f4ad177bab338210a0a3e52f5519dcc3 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit e8d03c5599e468937b0e4270309a3be3d710df8f)
* QVarLengthArray: fix compilation with GCC 7Marc Mutz2017-03-271-0/+1
| | | | | | | | | | | | | | | | | | | This fixes a warning-turned-Werror in qdistancefield.cpp: In member function ‘void QVarLengthArray<T, Prealloc>::realloc(int, int) [with T = bool; int Prealloc = 256]’, inlined from ‘void makeDistanceField(QDistanceFieldData*, const QPainterPath&, int, int)’ at ../../include/QtCore/../../../../qt5/qtbase/src/corelib/tools/qvarlengtharray.h:275:10: ../../include/QtCore/../../../../qt5/qtbase/src/corelib/tools/qvarlengtharray.h:390:19: error: ‘void* memcpy(void*, const void*, size_t)’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] memcpy(ptr, oldPtr, copySize * sizeof(T)); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Apparently GCC cannot rule out that copySize may be negative in the call to memcpy. Put GCC on the right track by adding a Q_ASSUME. Change-Id: I63e3801e52ebe2a7f77e3a97ef03ec3869319c8c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> (cherry picked from commit 5ca7d56aca5d7cae3f6eefad181839f9b3a2ece6)
* WINCE: Don't receive touches by default from gesturesAndreas Holzammer2017-03-242-2/+2
| | | | | | | | | | | | Windows Embedded Compact does send events from touch devices, as mouse event and as gesture event. There is no way to distinguish between a regular mouse event coming from a a connected physical mouse or a touchscreen. There is also no way to tell Windows to not deliver these touches as mouse events. Change-Id: Ia894ef9d1c0f8650f45f5bc328ce48f2505cac40 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QDockWidget: Fix memory leak when dragging a tab outside of a floating tab ↵Olivier Goffart2017-03-241-1/+2
| | | | | | | | | | | | | | | | window A QDockWidgetItem will be leaked if a QDockWidget is dragged out of a floating tab window, and then plugged back somewhere. The problem is that QMainWindowLayout::unplug was not returning the QDockWidgetItem* from the floating tab's layout. When that's the case, a new QDockWidgetItem is created in QDockWidgetPrivate::startDrag and will be put into the layout, leaking the old QDockWidgetItem. Change-Id: Ifb9c1c562cb74383ebff1df0f91ee225c5cdb296 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> (cherry picked from commit 4d3781b640e8fb0a04e96b2d05199247556b8d86)
* Fix hang on sleep/wakeupBogDan Vatra2017-03-231-9/+8
| | | | | | | | | | | | | | This patch fixes the followings: - call "it.value()" only on valid iterators - destroySurface() doesn't remove the surfaceId from m_surfaces - the surfaceId is removed from m_surfaces when the QtSurface is really destroyed Task-number: QTBUG-59185 Change-Id: Iee37dde16fee16f19906812c55c1f0b0279b033c Reviewed-by: Mathias Hasselmann <mathias.hasselmann@kdab.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit da4b91e2b2c6bb7949e2151a72be1f11c28768d6)
* QGuiVariant: fix unintended fall-throughMarc Mutz2017-03-221-0/+1
| | | | | | | | Found by GCC 7. Change-Id: I8a9cca5236f077335031afc90b2683a2846d3b79 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> (cherry picked from commit 8f7776df5e649a99377776d4f2b91c220632f36f)
* QToolBox: fix potential UB (invalid cast) in Private::_q_widgetDestroyed()Marc Mutz2017-03-221-6/+4
| | | | | | | | | | | | Don't cast an expiring QObject down to QWidget. Cast the QWidgets stored internally up to QObject to perform the comparison. The result is the same, but no invalid casts are possible anymore. Found by independent review. Change-Id: Iffa8a66cf5cab0270961befe982637ac8e4f0f7b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 26bc4ac5cb56ce8f2d3d10125fa9c6a72140573a)
* PostgreSQL: fix datetime format when system locale doesn't use arabic numeralsMichael Jabbour2017-03-221-1/+4
| | | | | | | | | | | psql driver was previously using QDateTime::toString() function which is locale-depndent. Task-number: QTBUG-59524 Change-Id: I7f50f95b5c82e66476abfee24ad28b78b3257041 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ac74abdf50f7047cf43b3577a70d0995e197659d) Reviewed-by: Julien Blanc <julien.blanc@nmc-company.fr> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QDir::mkpath: don't try to mkdir in automount filesystemsThiago Macieira2017-03-201-33/+65
| | | | | | | | | | | | | | | | | Automount filesystems like /home on many operating systems (QNX and OpenIndiana, at least) don't like if you try to mkdir in them, even if the file path already exists. OpenIndiana even gives you an ENOSYS error. So instead, let's try to mkdir our target, if we fail because of ENOENT, we try to create the parent, then try again. Task-number: QTBUG-58390 Change-Id: Ibe5b1b60c6ea47e19612fffd149cce81589b0acd Reviewed-by: James McDonnell <jmcdonnell@blackberry.com> Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit d9a2dd8d3b55d16d2e38d124abb0ade490963b37) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Call disconnectNotify() when disconnecting a QMetaObject::ConnectionUlf Hermann2017-03-171-2/+3
| | | | | | | | | | | In all other forms of disconnecting this is done. We also know the signal index, so there is no reason not to do this. Change-Id: Ic8b042cd8f45dbff74b42ee30c384a84bef78b20 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> (cherry picked from commit 972580accdd0732b33947e8b1ca0ba8943041bdc) Task-number: QTBUG-59500 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QChar: fix docs of (uchar) ctorMarc Mutz2017-03-161-2/+2
| | | | | | | | | | The constructor is not only disabled under QT_NO_CAST_FROM_ASCII, but also under QT_RESTRICTED_CAST_FROM_ASCII. Change-Id: I7bbaf2891913d5256dff7f80c49075ea3326155a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit e364384d9f91e57ad6116d549f3748d165b77ea2)
* Fix parsing of day-of-week names that start with another nameThiago Macieira2017-03-161-32/+9
| | | | | | | Task-number: QTBUG-59159 Change-Id: I95c9e502ccc74af3bcf0fffd14a69e0cd27ce96b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 04b8db3d57970631351fc6330af9553e94f1b14d)
* Close popups when blocked by modal dialogPaul Olav Tvete2017-03-143-1/+3
| | | | | | | | | Don't block the event that Qt depends on to close popups. Task-number: QTBUG-57292 Change-Id: Ida1f928b81868f68a7b1e19cd0b83485d2a7232e Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 5b65698248325576faa03a2bb78d17349a33a194)