summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* iOS: Send window-system event also when embedded in native iOS appTor Arne Vestbø2018-04-103-33/+51
| | | | | | | | | | The iOS event dispatcher has been split into two; one dealing with the QPA event processing, which we should always do, and one dealing with the longjumping that we do when running the user's main on a separate stack. Change-Id: I1f819db33c608aad130ff23cbbadcf84363a32d2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Revert "tst_QSslSocket::signatureAlgorithm - fix for OpenSSL 1.1"Timur Pocheptsov2018-04-101-7/+1
| | | | | | | | | | | This reverts commit e2694fa602e95a9043561e7dfb9f5956c08a5f14. I'm reverting this patch - I'll fix QSslSocket instead to respect the requested protocol version. Change-Id: Ia4bb09a8801c58bc76837518934ac7a3eedd3c07 Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtGui: Add qt_imageToWinHBITMAP(), qt_imageFromWinHBITMAP()Friedemann Kleint2018-04-103-78/+424
| | | | | | | | | | | Add functions for converting QImage to HBITMAP and back supporting additional formats of QImage (RGB888, RGB555, Indexed8 and Mono). Add test with roundtrip to tst_qimage similar to tst_QPixmap::toWinHBITMAP(). Task-number: QTBUG-51124 Change-Id: Ib568898e7162686bfa527d828785628eb0b78e21 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QCryptographicHash: Add a static method to retrieve hash lengthMårten Nordheim2018-04-103-0/+52
| | | | | | | | | | | | It's useful when you need to check how long a hash will be without first generating one. [ChangeLog][QtCore][QCryptographicHash] Add a static method, hashLength, which returns the length of the output of a hash function in bytes. Change-Id: Id6a454016523de83d157fd95c50105c6db4bb1d9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-1020-192/+252
|\ | | | | | | Change-Id: I0120f804522c0c652e9537b6e9fe08189f071ed2
| * macx-clang: Update informal documentation for xcb buildGabriel de Dietrich2018-04-091-2/+5
| | | | | | | | | | | | | | | | | | Remove references to XKB and explain what to do if pkg-config is missing or unwanted. Change-Id: I099bf01ff49e1b8f6e822a50f0fe4904965a7a9f Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * xcb: various coding style cleanups in qxcbbackingstoreGatis Paeglis2018-04-092-37/+33
| | | | | | | | | | | | | | | | | | | | | | - Pass QXcbBackingStoreImage a pointer to QXcbBackingStore. This allow for simpler QXcbBackingStoreImage ctor. - Use member initializers. Change-Id: Ia992390060bb30e1184813cd0d115a8bf0fbc237 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * xcb: rename two classes in qxcbbackingstoreGatis Paeglis2018-04-092-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QXcbShmImage to QXcbBackingStoreImage as it is an image that might or might not have SHM capability. The current name implies that it always uses SHM. QXcbShmGraphicsBuffer to QXcbGraphicsBuffer as it has nothing to do with SHM. Change-Id: I57ced75891e8b10515142769278a7f3f40da91ef Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Configure: Restore default prefix on WindowsOrgad Shaneh2018-04-091-3/+7
| | | | | | | | | | | | | | | | | | The configure unification accidentally changed it to /usr/local as used on unix. Use C:/Qt again. Task-number: QTBUG-61373 Change-Id: I758c639bdb07c97b55f990821e73a5135038f4a0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Doc: Update QVariant::toString description, update see also linksPaul Wicking2018-04-091-43/+48
| | | | | | | | | | | | | | | | | | | | Change the toString description to reflect that the listed types are not exclusive, and update see also link to link to the canConvert method that includes conversion table. Task-number: QTBUG-67174 Change-Id: I3ad2889c98a235995b94a2d0496a6fb8c024b7bb Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * Unblacklist qsslkey for LinuxMårten Nordheim2018-04-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Except RHEL-6.6 and 7.4 It was blacklisted in f3939d943ed132eaf3daead797d961c3ffbc31a5, along with a lot of other entries. No specifics are known about why it was blacklisted originally, but now it only fails on RHEL because they use OpenSSL 1.0.1. Change-Id: I6d1d1b7b7bf5386b2115b8780163550cf03bbad7 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Fix integer overflow (1 << 31)Mikhail Svetkin2018-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | On platforms where integer by default is int32(max is 2147483647) and (1 << 31) will be 2147483648 Change-Id: I59ccb5344d5ad7d085f01bbc7cebdf6152ff7755 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Fix TlsV1SslV3 case in the WinRT SSL backendMårten Nordheim2018-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | It would previously only enable TLS v1.0, but it should also enable SSL v3. According to Microsoft's documentation[0] that is exactly what "SocketProtectionLevel_Ssl" does. [0]: https://docs.microsoft.com/en-us/uwp/api/windows.networking.sockets.socketprotectionlevel Change-Id: Id48f1ad310d994b8379116c9fa2102db858d7f69 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * tst_QClipboard: Skip on Wayland, as it requires real input eventsJohan Klokkhammer Helsing2018-04-091-12/+7
| | | | | | | | | | | | | | | | On Wayland, manipulating the clipboard requires an input event serial, which is not possible to get unless the compositor sends us input events. Change-Id: If5231a5db85f8d6ad988ea93f240cee0c3466f9f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * tst_QTouchEvent: Wait for window exposed instead of activeJohan Klokkhammer Helsing2018-04-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | This makes the tests pass on Wayland compositors that don't automatically give focus to newly created windows. Such as a headless Weston, which is very useful for testing. Task-number: QTBUG-66846 Change-Id: I502504b333499c89be193a3ebc19d41264a13580 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * Doc: Update connect syntax in I18n Widgets ExampleNico Vertriest2018-04-092-4/+7
| | | | | | | | | | | | | | Task-number: QTBUG-60635 Change-Id: Icfa0d09ac6c9ad4396fbe1138277bb1dd866a803 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Add brief statements to Address Book Example chaptersNico Vertriest2018-04-091-2/+8
| | | | | | | | | | | | | | Task-number: QTBUG-60635 Change-Id: Ice6d2b6a475ba4352a87bb46366826334aed2af2 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Update Find Files exampleNico Vertriest2018-04-092-39/+66
| | | | | | | | | | | | | | | | | | | | - review text - update screenshot Task-number: QTBUG-60635 Change-Id: I596ce0e08be9ed9aea7834eeda1c3c2c19c28d7a Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Update Event Transitions ExampleNico Vertriest2018-04-092-7/+20
| | | | | | | | | | | | | | | | | | | | - added screenshot - some modifications to the text Task-number QTBUG-60635 Change-Id: I57b269f93cdba696b424b5ba008d0f46ac612cda Reviewed-by: Martin Smith <martin.smith@qt.io>
| * Fix license header for tst_toolingsupport.cppKai Koehne2018-04-091-13/+12
| | | | | | | | | | | | Change-Id: Id355afc8eb57a40a0f8d06fa2920f03d94ef9337 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: hjk <hjk@qt.io>
| * tst_QPrinter: Use qWaitForWindowActive() to wait for dialogKari Oikarinen2018-04-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of an unconditional wait. The QSKIP is necessary because the PDF format is non-native and the Windows implementation of QPrintDialog doesn't work then. The macOS implementation has the same warning, so add the check for that OS as well. The test has previously passed, since it hasn't seen not actually opening the dialog as an issue. Change-Id: Ib53e378b232580358f13e0c5206404412f9e6ee2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * QSemaphore: Fix 64-bit Linux QSemaphores initialized to non-zeroThiago Macieira2018-04-061-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original design for the 64-bit futex had the token count replicated in the high part. But the constructor wasn't setting it. This is one of the issues I had noticed when investigating QTBUG-66875, but didn't need to address since the the fix I ended up applying in commit 081c001deb75fa38385d3ff8cbbdb4f788529133 made that unnecessary: the high part only had the number of waiters. Unfortunately, when commit f502270c0f06daba75c1da381bd1658d81aa7bba brought back the token count in the high part, I failed to correct that problem. As a consequence, every QSemaphore that was initialized in the constructor to a non-zero value would eventually deadlock. This commit fixes that oversight. Task-number: QTBUG-67481 Change-Id: I662b8f168c74440ab1a8fffd1522be6b85adb4d0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io>
* | xcb: minor cleanups around QT_CONFIG(xcb_xlib)Gatis Paeglis2018-04-093-26/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove unused createVisualInfoForDefaultVisualId() function. This amends dff3c0f14f3c3a7288c456028d5bec23bee5406a. - Inline QXcbConnection::xlib_display(). - Don't nest QT_CONFIG(xcb_native_painting) in QT_CONFIG(xcb_xlib). configure.json already checks for the dependencies, we don't need to do that again in *.h/*.cpp. Change-Id: If39912e67ce9baa31faf091bebe120bac5cf6876 Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | eglfs/kms: also set windowing properties on planesLionel CHAZALLON2018-04-093-0/+16
| | | | | | | | | | | | | | | | | | The 0 values should be default for X,Y both on plane and crtc. But atomic implementation can have flaws on some devices so we don't assume they are defaulted right and set them to 0. Change-Id: I2f7dc98fdba523eb46eb86b97568d18b6cfd1277 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | qtmain_winrt: Dynamically increase debug message mapping sizeOliver Wolff2018-04-091-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If large debug strings are received, the application should not crash, but the file mapping's size should be increased accordingly. To signal the need for a bigger mapping to the client, the new message type was introduced. If winrtrunner receives a message with this type, it will close the file mapping so that a new one can be created. Task-number: QTBUG-61911 Change-Id: I3d5b5770870257a965b80e369975d3869e9a5446 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | qtmain_winrt: Synchronize debug message callsOliver Wolff2018-04-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When winrtrunner is used to debug winrt applications, debug messages should be acknowledged by winrtrunner. Otherwise it is possible, that 2 messages are sent (and their event set) before winrtrunner reacted. In this case the first message was lost and the second message shown twice. Change-Id: Ib1c6f87aad0c0da1761be5bf467edf8d4476c5e3 Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | qtmain_winrt: Protect debug message handler with mutexOliver Wolff2018-04-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | The code can be accessed from several threads and thus should be protected. Change-Id: I38c67c5d0f9b1658da1d0ae45d3ea79bbe4e8dff Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Declare the operator| in the Qt namespace for QFlags in that namespacesOlivier Goffart2018-04-082-23/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a long overdue change so we don't break ADL of operator|. I think will not break source or binary compatibility. The problem is code like this: namespace Foo { struct MyStruct; MyStruct operator|(MyStruct, MyStruct); void someFunction() { fooLabel->setAlignement(Qt::AlignLeft | Qt::AlignTop) } } This would be an error before as ADL would find only the Foo::operator| and not the global one since the arguments are not in the global namespace. After this change, ADL works fine and this code compiles This bites people with misterious error, see questions on https://stackoverflow.com/questions/10755058/qflags-enum-type-conversion-fails-all-of-a-sudden https://stackoverflow.com/questions/39919142/broken-bitwise-or-operator-in-a-qt-project [ChangeLog][QtCore] QFlags's operator| for enum types in the Qt namespace are now declared in the Qt namespace itself. Change-Id: I021bce11ec1521b4d8795a2cf3084a0be1960804 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QVariant: Avoid a memory allocation with custom typesOlivier Goffart2018-04-081-3/+10
| | | | | | | | | | | | | | | | | | | | Store big or un-movable custom type within the same memory region as the QVariant::PrivateShared. Makes tst_qvariant::bigClassVariantCreation 33% faster Change-Id: I60a757d1f0a9a02cf9ac36fb53a72426b2f8cfa8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-0718-67/+137
|\| | | | | | | Change-Id: Idf2bef470663864069bbf7e41af07b534936863a
| * Revise dates of Pacific/Kiritimati's day-skip transitionEdward Welbourne2018-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The TZ database has recently revised its ccount of when they skipped a day to cross the international date line, from skipping Jan 1st 1995 to skipping December 31st 1994. So Move the before-days check to December 30th; and correct the Feb 2nd that was meant to be Jan 2nd (and does need to remain so, for compatibility with systems with out of date data). Task-number: QTBUG-67497 Change-Id: I5b9483c553205817f995f91793662a5a85e03192 Reviewed-by: Liang Qi <liang.qi@qt.io>
| * QOpenGLTexture: Set wrap mode if NPOT textures are not fully supportedJohan Klokkhammer Helsing2018-04-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OpenGL wrap mode defaults to GL_REPEAT although it is not supported for non-power-of-two textures on hardware that only has limited support. I.e. the following would create a texture with an invalid wrap mode: auto *t = new QOpenGLTexture(QOpenGLTexture::Target2D); t.setSize(123, 456); This patch adds a check in QOpenGLWindow::setSize to see if it's called with a non-power-of-two size on hardware without full support, and if so sets wrapMode to ClampToEdge (which should work on devices with limited support). Task-number: QTBUG-67418 Change-Id: I56e9f4383dbf5430c2bc5e4e9e585712b3603c13 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Pass on local html links with a fragment to openUrl()Andy Shaw2018-04-061-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | If a file link to a html file has a fragment part included then this will be lost when passed to QDesktopServices::openUrl() as this is not kept in the conversion of the QUrl. So by checking the filename in the case of a fragment existing in the url, we can be sure that the information is passed on correctly for html files. Task-number: QTBUG-14460 Change-Id: I8167d8c164713dd999603ba9e74150f4f1a4abea Reviewed-by: David Faure <david.faure@kdab.com>
| * oci: Use OCIBindByPos2 to accommodate data longer than USHRT_MAXAndy Shaw2018-04-062-3/+27
| | | | | | | | | | | | | | | | OCIBindByPos2 is only needed when using execBatch(), binding data that is longer than USHRT_MAX works for exec() so this is left unchanged. Change-Id: Ifdcf91939d184f225d24c13052ea0b81611ecf91 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * tests/auto/other: Avoid unconditional qWait()sKari Oikarinen2018-04-062-14/+3
| | | | | | | | | | | | | | | | | | There is no need to qWait() before a QTRY_VERIFY. qWait() will also intermittently handle events while waiting, so calling it in a loop isn't necessary. Change-Id: Ica7fbf18c03e673213dd9b72f31f71937cdcb145 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * QMimeDatabase: fix assert when fetching data for invalid mimetypeDavid Faure2018-04-062-0/+4
| | | | | | | | | | | | | | | | | | The Q_ASSERT(mimePrivate.fromCache) at qmimedatabase.cpp:218 which I added in commit 7a5644d648, was being triggered when calling comment() for invalid mimetypes such as db.mimeTypeForName(""). Change-Id: I8037041a4b435d2a5ba24ec94b7858e38b2f0bf2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QSqlDatabase: Skip confusing thread warning on invalid QSqlDatabaseDavid Faure2018-04-062-2/+7
| | | | | | | | | | | | | | | | | | If the db isn't valid, then that's the actual issue, not the fact that we're getting the same invalid db (with the same driver QSqlNullDriver) in multiple threads. Change-Id: I95490818ed78e741c3823e115f139c2cff01b0b1 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * Fix visual artifacts in diffuse image dithering (the default)Eirik Aavitsland2018-04-061-4/+8
| | | | | | | | | | | | | | | | | | | | The distributed error fractions in the Floyd-Steinberg dithering algorithm were not computed precisely. In particular, rounding errors could be accumulated, leading to visual artifacts. Task-number: QTBUG-67425 Change-Id: I77b48c3cab3e66ca161721d14b58fcc4188e74a8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Set WindowsTargetPlatform[Min]Version if WindowsSDKVersion is setJoerg Bornemann2018-04-061-5/+19
| | | | | | | | | | | | | | | | | | | | | | This fixes qmake-generated project files for Visual Studio 2017 for setups where the Windows 8.1 SDK is not installed. Task-number: QTBUG-66265 Change-Id: I67712019f7142e40262f171eb23f9f1e6ab3a251 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * tst_QLocale: Avoid manual deletesKari Oikarinen2018-04-061-14/+19
| | | | | | | | | | | | | | | | | | Also use data-driven test to reduce duplication. Change-Id: I9516e52267cb3c7b239030fd73dbbf23ac8f52f7 Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * winrt: socket engine: Replace last occurrences of old connect syntaxOliver Wolff2018-04-061-3/+6
| | | | | | | | | | Change-Id: I1d2f3b0b39de252f5392a2411ff4e3d94fd8593b Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * winrt: Properly deinitialize socket on connection failureOliver Wolff2018-04-061-0/+1
| | | | | | | | | | | | Change-Id: I4dde73423111ca4af386fa76ac26d1a1161fe493 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * winrt: process pending data before closing a socket connectionOliver Wolff2018-04-062-6/+22
| | | | | | | | | | | | | | | | | | | | | | If data is received and the remote immediately closes the connection, it was possible that data was lost. If a remote closes the connection make sure that any pending data is processed, before signaling closing of the socket. Change-Id: Ia94a616a31184fd28695919baaff99811fe0f1dd Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * Doc: Remove section about Qt Gui in Qt 4 from overview pageKai Koehne2018-04-061-13/+0
| | | | | | | | | | | | | | | | | | | | Qt 5 is now old enough that the delta to Qt 4 doesn't need to be on the central module page anymore. This is best left to https://doc.qt.io/qt-5/portingguide.html Change-Id: If65ef91765e1aca37fd7f107c2334ac65e403cd3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * Avoid multiple connections to same response in FileChooser portalJan Grulich2018-04-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | When not specified, xdg-desktop-portal keeps using same Request object over and over when returning response, causing multiple connections to same slot on same DBus object. While this is not problem when using FileDialog just once, it is a problem for QML FileDialog which is usually reused. For this purpose x-d-p provides handle_token option where you can specify token to be used when creating Request objects. Change-Id: Ie6569700c48e05fcefa4d5c22c921410f87ea7ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QVector2D/QVector3D/QVector4D: ensure well-defined behaviorGiuseppe D'Angelo2018-04-066-232/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of QVectorND classes is to store N floats packed together. One of their usecases is to build arrays of them, then using them as an array of floats (e.g. when uploading data to OpenGL). The design of the class however has a major problem: using separate members does not guarantee that the compiler does not insert padding between them (although that could be static-asserted). What's worse, the implementation of operator[] just does pointer arithmetic on the first member of the class; that's undefined behavior, and will trigger ASAN warnings in the future [1]. Solve both problems by using an array of floats instead of individual x/y/z/w members. Now the compiler is not allowed to insert hidden padding any more, and makes operator[] well-defined. However this might be a BIC (IF the compiler added paddings in the past): hence, add static_asserts checking that the memory layout of the classes hasn't changed. For good measure, also add static_asserts checking 1) that the class is standard_layout, so it's safe to reinterpret_cast it to its first (and only) member; 2) that there's no padding at the _end_ of the class. Note: an alternative solution to the operator[] problem could've been leaving the class untouched, and reimplementing the operator via a switch. Unfortunately none between GCC, clang and MSVC compile away the switch, dramatically pessimizing the code. [1] https://github.com/google/sanitizers/wiki/AddressSanitizerIntraObjectOverflow Change-Id: Iec00ffb6044c58cf728de1754a780068f88152cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Generalize composition functionsAllan Sandfeld Jensen2018-04-062-472/+645
| | | | | | | | | | | | | | | | Change the composition functions upto and including comp_func_plus to a templated structure sharing implementations. Change-Id: I14bcb4b28870aacffce78f372589fdebbaf12ecf Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Qt Forward Merge Bot2018-04-0614-25/+62
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-0614-25/+62
| |\| | | | | | | | | | Change-Id: Ic811cd444e523b904211797112bba6aaec85dddd
| | * configure: Detect Cocoa instead of CarbonGabriel de Dietrich2018-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | Change-Id: I9d1ff47481ad450b4b57c82e15186657eb7dcf93 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>