summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* JPEG image handler: remove undefined behavior from setjmp/longjmpGiuseppe D'Angelo2019-10-111-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The JPEG writing code features a setjmp/longjmp pair to deal with error handling. In doing so, it creates UB by touching local objects after the setjmp and then after the corresponding longjmp. The rules on what we can do are quite strict: objects that are 1) local to the function calling setjmp; 2) not qualified with volatile; 3) written into after the setjmp; have indeterminate state after the corresponding longjmp call (man 3 longjmp, C 2x draft N2346 §7.13.2.1.2). Not making any assumptions on any compiler used: let's just say that using them in any way is UB. Luckily, no compiler exploits this (yet), and the code works just fine. But we know the drill -- never play this game against compilers, because you will lose. So: we have a couple of those objects around in the writing routine (cinfo, row_pointer), that violate the rules above. Unfortunately we can't simply mark them as volatile: libjpeg's API expects them not to be volatile. Casting volatileness away and then touching an object in any way is undefined behavior out of the bat (C 2x draft N2346 §6.7.3.7, C++ [dcl.type.cv]). Given the code needs to do 3), and we can't work around 2), then work around 1): define them to be non-local to the function doing the setjmp. Introduce a small helper that declares such objects and then calls the function doing the actual work, with the setjmp/longjmp. An overall alternative would be of course stop using setjmp/longjmp, but libjpeg's API doesn't really seem to allow this -- when the library calls user's error handler, that error handler is expected not to return to the library (so a longjmp or an exit/abort are mandatory). Side note: all the code using libjpeg I've researched to debug this has this very same strange issue: * GDK-pixbuf's [1] * ImageMagick's [2] * and even libjpeg's [3] and libjpeg-turbo's [4] own examples. [1] https://github.com/GNOME/gdk-pixbuf/blob/master/gdk-pixbuf/io-jpeg.c#L581 [2] https://github.com/ImageMagick/ImageMagick/blob/master/coders/jpeg.c#L2338 [3] https://www.ijg.org/ [4] https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/example.txt#L331 Change-Id: I34a810db468f73423478cd3ac71b888f4b11cb28 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* JPEG image handler: drop a use of "volatile"Giuseppe D'Angelo2019-10-111-2/+1
| | | | | | | | | | | | The reading code protects a local variable with volatile. In this case the only possible reason to apply volatile seems to be protecting the variable across the subsequent setjmp/longjmp. However, the variable is never accessed after the longjmp (the function returns). So, drop the volatile. Change-Id: Ibecb11a9edcc6027b2fd52b555287ad53375a5d0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix infinite recursion caused by the RDSEED featureThiago Macieira2019-10-111-40/+63
| | | | | | | | | | | | | We made qRandomCpu() call qCpuHasFeature(), which needs to test that RDRND works and does so by calling qRandomCpu(). So disentangle that by making sure we don't recurse. And by making sure that we fill the buffer with RDRND data, not with RDSEED. Fixes: QTBUG-79162 Change-Id: Ib5d667bf77a740c28d2efffd15cc583a9afcb97a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Win: QUdpSocket: Use QVarLengthArray for retrieving sizeMårten Nordheim2019-10-114-7/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increased size of the peek buffer to 2048 from 1500 and now uses QVarLengthArray with space for 10 stack-allocated WSABUF instances, but still growing at the pace of 5. In benchmarking (created for and included in this patch) this shows better performance when retrieving the datagram size for larger datagrams, and the same performance as before for smaller datagrams (at the cost of 2048 - 1500 + 16 * 10 = 708 bytes extra stack space). Benchmarks: With changes: ********* Start testing of tst_QUdpSocket ********* Config: Using QtTest library 5.13.1, Qt 5.13.1 (x86_64-little_endian-llp64 shared (dynamic) release build; by MSVC 2019) PASS : tst_QUdpSocket::initTestCase() PASS : tst_QUdpSocket::pendingDatagramSize(52) RESULT : tst_QUdpSocket::pendingDatagramSize():"52": 0.0038 msecs per iteration (total: 63, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(1024) RESULT : tst_QUdpSocket::pendingDatagramSize():"1024": 0.0039 msecs per iteration (total: 64, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(2049) RESULT : tst_QUdpSocket::pendingDatagramSize():"2049": 0.0038 msecs per iteration (total: 63, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(4500) RESULT : tst_QUdpSocket::pendingDatagramSize():"4500": 0.0039 msecs per iteration (total: 64, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(4098) RESULT : tst_QUdpSocket::pendingDatagramSize():"4098": 0.0040 msecs per iteration (total: 66, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(8192) RESULT : tst_QUdpSocket::pendingDatagramSize():"8192": 0.0040 msecs per iteration (total: 67, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(12000) RESULT : tst_QUdpSocket::pendingDatagramSize():"12000": 0.010 msecs per iteration (total: 90, iterations: 8192) PASS : tst_QUdpSocket::pendingDatagramSize(25000) RESULT : tst_QUdpSocket::pendingDatagramSize():"25000": 0.021 msecs per iteration (total: 88, iterations: 4096) PASS : tst_QUdpSocket::pendingDatagramSize(32768) RESULT : tst_QUdpSocket::pendingDatagramSize():"32768": 0.033 msecs per iteration (total: 69, iterations: 2048) PASS : tst_QUdpSocket::pendingDatagramSize(64512) RESULT : tst_QUdpSocket::pendingDatagramSize():"64512": 0.088 msecs per iteration (total: 91, iterations: 1024) PASS : tst_QUdpSocket::cleanupTestCase() Totals: 12 passed, 0 failed, 0 skipped, 0 blacklisted, 3090ms ********* Finished testing of tst_QUdpSocket ********* Without changes: ********* Start testing of tst_QUdpSocket ********* Config: Using QtTest library 5.13.1, Qt 5.13.1 (x86_64-little_endian-llp64 shared (dynamic) release build; by MSVC 2019) PASS : tst_QUdpSocket::initTestCase() PASS : tst_QUdpSocket::pendingDatagramSize(52) RESULT : tst_QUdpSocket::pendingDatagramSize():"52": 0.0039 msecs per iteration (total: 65, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(1024) RESULT : tst_QUdpSocket::pendingDatagramSize():"1024": 0.0039 msecs per iteration (total: 65, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(2049) RESULT : tst_QUdpSocket::pendingDatagramSize():"2049": 0.0040 msecs per iteration (total: 66, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(4500) RESULT : tst_QUdpSocket::pendingDatagramSize():"4500": 0.0040 msecs per iteration (total: 67, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(4098) RESULT : tst_QUdpSocket::pendingDatagramSize():"4098": 0.0040 msecs per iteration (total: 67, iterations: 16384) PASS : tst_QUdpSocket::pendingDatagramSize(8192) RESULT : tst_QUdpSocket::pendingDatagramSize():"8192": 0.010 msecs per iteration (total: 90, iterations: 8192) PASS : tst_QUdpSocket::pendingDatagramSize(12000) RESULT : tst_QUdpSocket::pendingDatagramSize():"12000": 0.010 msecs per iteration (total: 90, iterations: 8192) PASS : tst_QUdpSocket::pendingDatagramSize(25000) RESULT : tst_QUdpSocket::pendingDatagramSize():"25000": 0.033 msecs per iteration (total: 69, iterations: 2048) PASS : tst_QUdpSocket::pendingDatagramSize(32768) RESULT : tst_QUdpSocket::pendingDatagramSize():"32768": 0.0502 msecs per iteration (total: 103, iterations: 2048) PASS : tst_QUdpSocket::pendingDatagramSize(64512) RESULT : tst_QUdpSocket::pendingDatagramSize():"64512": 0.13 msecs per iteration (total: 70, iterations: 512) PASS : tst_QUdpSocket::cleanupTestCase() Totals: 12 passed, 0 failed, 0 skipped, 0 blacklisted, 3192ms ********* Finished testing of tst_QUdpSocket ********* Fixes: QTBUG-78275 Change-Id: If86a226620244aa4e470600c6c1db4a7863b5617 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QObject: use delegate constructorsGiuseppe D'Angelo2019-10-111-23/+1
| | | | | | | | | Avoid the massive code duplication in the two QObject constructors. The only slight difference is the code path checking for isWidget; I'd say that paying for that one is worth the price of de-duplicating. Change-Id: I3af749738fe7d6b7adf287009d1815396a2f1407 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deprecate reverse iteration on QSetLars Knoll2019-10-102-29/+49
| | | | | | | | | | | | | std::unordered_set only supports forward iteration for good reasons. Align our API with this by deprecating reverse iteration and the operator+/-() for iterators. [ChangeLog][QtCore][QSet] Reverse iteration over QSet is now deprecated. Change-Id: Ia6e3346a6474c454c63010d855850ae4ff12e1a4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Deprecate calling QList::insert/removeAt with out of bounds indexLars Knoll2019-10-102-5/+20
| | | | | | | | | | | | | | Users should not call any QList API with indices that are out of bounds. Deprecate this behavior and make sure users get warnings in debug mode and assertions if they disable deprecated functionality. [ChangeLog][Important Behavior Changes] Calling QList::insert() or removeAt() with an out of bounds index is deprecated and will not be supported in Qt 6 anymore. Change-Id: I97adecc2e2aabd36ea2cc69e0895d625f78b32a0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Remove potential out of bounds accesses to QListLars Knoll2019-10-102-2/+7
| | | | | | Change-Id: I13431e45ef329921a8846c38047f704a299a1a94 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* tst_QAbstractItemView: cleanupChristian Ehrlicher2019-10-101-384/+280
| | | | | | | | | | | | | | | Cleanup QAbstractItemView autotest: - use range-based for loops - use nullptr - use member initialization - use new signal/slot syntax - use static invocations - use override - replaced QCoreApplication::processEvents with QTRY_VERIFY/QTRY_COMPARE Change-Id: Iba91811db6fb925364fc88ec36357e758b937329 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix strange qmake syntaxFrederik Gladhorn2019-10-101-1/+1
| | | | | | | | | | It seems like qmake is happy with the comment, followed by a continuation and then another comment, but having the continuation at the end of the line makes more sense. This will make it easier to port to CMake. Change-Id: I20c964e8c3b6fea4745095783503045b191b000b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-1039-510/+2641
|\ | | | | | | Change-Id: Iadeca81f499d6b19e86ceae1edd7960db2575e90
| * Add qt.qpa.input.events logging to evdevtouchShawn Rutledge2019-10-101-0/+7
| | | | | | | | | | | | | | | | | | | | The xcb platform plugin uses this category for detailed input event logging, so we might as well be consistent in evdevtouch. When hardware supports pressure sensing, it's likely to need extra debugging. Task-number: QTBUG-77142 Change-Id: I7682bb5d49e669054523f9cf556715e511bcd572 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Fuzzing: Don't copy input data to QByteArrayRobert Loehning2019-10-094-4/+4
| | | | | | | | | | Change-Id: I603413805dca46a85709c2ab6ff573687849572e Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
| * Remove a new-lineTimur Pocheptsov2019-10-091-1/+0
| | | | | | | | | | | | | | that was accidentally introduced this week. Change-Id: I0731c7c64e51b40f230b42694603056d89a05712 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * rhi: Autotest for rendering a triangle into a windowLaszlo Agocs2019-10-092-1/+160
| | | | | | | | | | Change-Id: Id1562ff8cf7c6bc7e5bd147bb628f3d9dd57f2b5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * rhi: Autotest rendering with uniform bufferLaszlo Agocs2019-10-099-0/+246
| | | | | | | | | | Change-Id: I4251f31494680c78e90a08a2b471cb1af08ecd81 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * rhi: Autotest rendering a textured quadLaszlo Agocs2019-10-0910-0/+190
| | | | | | | | | | | | Task-number: QTBUG-78971 Change-Id: I0e7e0f3c00f9509031f7b4a8a389e51c915f01c2 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * rhi: Enable the qrhi autotest on WinRTLaszlo Agocs2019-10-093-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | There is no onscreen support for WinRT in the D3D11 backend yet. However, offscreen operations (rendering into a texture) should work. One catch is that there is no D3DCompile available for deployed WinRT apps. So ship the intermediate format (DXBC output from fxc) in the .qsb files. Change-Id: Ic0aba4b817c27d13dcf3af41bf7612d799382655 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * rhi: Fix non-base level copy and readback wrt source sizeLaszlo Agocs2019-10-094-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | When the source size is not explicitly specified, we take the entire subresource. However, just using the texture's size is wrong: when the source level in a copy or readback is not 0, the size for the corresponding mip level has to be used instead. This fixes occasional crashes with Metal in the autotest. Change-Id: I99f689feef93ec86dffdc9e82d6bfdaf5c1eb041 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * rhi: Autotest rendering a triangleLaszlo Agocs2019-10-0915-34/+300
| | | | | | | | | | | | | | | | | | Also improve (docs and runtime checks) and test the minimum set of required data to create a graphics pipeline. Task-number: QTBUG-78971 Change-Id: If5c14f1ab1ff3cf70f168fde585f05fc9d28ec91 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * rhi: gl: Add a feature flag for reading back non-zero mip levelsLaszlo Agocs2019-10-098-16/+53
| | | | | | | | | | | | | | | | | | The joys of "level - Specifies the mipmap level of the texture image to be attached, which must be 0." for glFramebufferTexture2D in OpenGL ES 2.0. Change-Id: Iaf19502f48d7ba73b26abb72535bfa6696a1e182 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * rhi: gl: Switch GetBufferSubData emulation to MapBufferRangeLaszlo Agocs2019-10-093-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Use only APIs that are in GLES 3.0. glMapBuffer() is an old OES extension, stop bothering with that. Not the least because ANGLE claims supporting it and then fails the map. (not that we care much about ANGLE, but, for instance, the qrhi autotest is run with ANGLE configurations as well in the CI, so have to still take care of it for the duration of Qt 5.x) Change-Id: I29140402cedffe0430f920ee0c061673257c3aa1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * rhi: Autotest basic texture operationsLaszlo Agocs2019-10-094-25/+509
| | | | | | | | | | | | | | | | | | | | | | | | ...and make the Null backend able to deal with these, for RGBA8 textures at least. Naturally it is all QImage and QPainter under the hood. Also fix a bug in the OpenGL backend, as discovered by the autotest: the size from the readback did not reflect the mip level. Task-number: QTBUG-78971 Change-Id: Ie424b268bf5feb09021099b67068f4418a9b583e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * Make QRhi::create() return false when there is no MTLDeviceLaszlo Agocs2019-10-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The interesting part here is that sending messages to a null object is valid in Objective-C, so without an explicit check it is not necessarily straightforward to discover that we do not have working rendering. (because the application won't just simply crash) Do the right thing now and return false like other backends do. Task-number: QTBUG-78994 Change-Id: I0d3c4a49a3fc78f9149f8af4fe67d581e74daae7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * rhi: Add support for buffer readbacksLaszlo Agocs2019-10-0913-441/+860
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also marks the beginnings of significantly extending autotesting of the resource and rendering functionality in QRhi. Also involves fixing up the buffer operation lists like we did for textures before. This is to ensure updates and reads on the same batch execute in the correct order. So just have two lists: one with buffer, one with texture operations. Also simplify the struct layouts. No need for those inner structs with many duplicate members. This reduces the size even, since using a union was never an option here. Also switch to a VLA, the size is around 253 KB per batch. The Null backend now keeps track of the QRhiBuffer data so it can return valid results in readbacks. Task-number: QTBUG-78984 Task-number: QTBUG-78986 Task-number: QTBUG-78971 Task-number: QTBUG-78883 Change-Id: I9694bd7fec523a4e71cf8a5c77c828123ebbb3bd Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * rhi: Exercise nativeHandles() in qrhi testLaszlo Agocs2019-10-091-2/+244
| | | | | | | | | | | | | | Task-number: QTBUG-78971 Task-number: QTBUG-78972 Change-Id: Ibce10caf1ccd74ae7efead9579f4a4342ef896b8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * Suppress deprecation warnings on a test of a deprecated QString methodEdward Welbourne2019-10-091-0/+3
| | | | | | | | | | | | | | | | QString::fromAscii() is deprecated since 5.0 but still tested. So suppress deprecations for its code. Change-Id: Ic048a843c43551021da39a16d94c3222201573dc Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
| * QAuthenticator - use GSS framework, as Apple requiresTimur Pocheptsov2019-10-092-2/+17
| | | | | | | | | | | | | | | | | | since declarations in gssapi.h are marked as deprecated. Fixes: QTBUG-78810 Change-Id: I241ae4913f362f6e9219438e9bfe7a63dfc91b7c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * qmake: Avoid writing glue project file when only generating prl filesTor Arne Vestbø2019-10-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When qmake is run with -prl we don't need to write the glue makefile, and doing so will end up with MakefileGenerator::writeProjectMakefile trying to write to an invalid Option::output, resulting in warnings: QIODevice::write device not open Change-Id: I196b185570e7329c621c2ccb8530b43f4be51ee6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * QtConcurrent: fix warning about function parameters shadowing class membersVolker Hilsheimer2019-10-081-10/+10
| | | | | | | | | | | | | | | | No functional change. Change-Id: I76aa01e8eb044c794d518ca72e6861cf95060dfc Fixes: QTBUG-79071 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QWidget: document that a widget might only get a mouseDoubleClickEventVolker Hilsheimer2019-10-081-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | If two widgets are on top of each other, and the top widget disappears in response to a press or release that is followed by a double click, then the widget at the bottom only receives the double click event. This is a sequence of events that the application developer that choses to build such a UI has to take care of. Change-Id: I440efd2cac01631de8995abf9a9fb76815de8f9a Fixes: QTBUG-61173 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * evdevtouch: Report stationary touchpoints that include pressure changesShawn Rutledge2019-10-081-1/+5
| | | | | | | | | | | | Task-number: QTBUG-77142 Change-Id: I35446092679573df51891302155c896a3bb6fc1c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Explain an usage of volatileGiuseppe D'Angelo2019-10-091-0/+5
| | | | | | | | | | | | | | It's to work around QTBUG-45307. Change-Id: Ib6076223013e5b1ccfa6ec25e2d040daaa2f19dd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* | QRandom: add support for RDSEEDThiago Macieira2019-10-098-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Intel whitepaer[1] recommends using the RDSEED over RDRAND whenever present. libstdc++ from GCC 10 will also use it in std::random_device. [ChangeLog][QtCore][QRandomGenerator] The system() random generator will now use the RDSEED instruction on x86 processors whenever available as the first source of random data. It will fall back to RDRAND and then to the system functions, in that order. [1] https://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide Change-Id: I907a43cd9a714da288a2fffd15bab176e54e1975 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-0911-16/+106
|\| | | | | | | Change-Id: I03d82c5bc47908a97e7a908d7e67a7301b28d8cb
| * Handle context loss in QPlatformBackingStoreDavid Edmundson2019-10-081-1/+10
| | | | | | | | | | | | | | | | This powers a QQuickWidget and we also need to reset the context if we get a context loss event. Change-Id: Id8b7112606670985860069c2bb11cf141b3ac723 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * CoreText: Warn the user when family alias lookup slows down the applicationTor Arne Vestbø2019-10-084-8/+48
| | | | | | | | | | | | | | | | | | | | | | If the user specifies a font family in their application that doesn't exist in the system, or one that uses the localized family name, we will end up resolving the family alias for all fonts in the system, which typically adds 600-800ms of startup time. Let the user know when this happens. Change-Id: Id8d6f55028e37f681ec4a686df25d33240b5a30f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * macOS: Pass required parameters to NSOpenSavePanelDelegate callbacksTor Arne Vestbø2019-10-081-3/+3
| | | | | | | | | | | | Change-Id: I0e0322734a077e4ee948128f3ba6c074514ccbb9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Fix double free when debug printing QFont with non-default verbosityTor Arne Vestbø2019-10-081-2/+1
| | | | | | | | | | | | Change-Id: Ieb7fa19e8bdd98f5283f7f6d8751e6532c8e0fc4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Add libfuzzer test for QTextLayout::beginLayout()Robert Loehning2019-10-072-0/+39
| | | | | | | | | | | | Task-number: QTBUG-77819 Change-Id: I34e9cbaa615896222bcf947012cfed9f6c3186c7 Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
| * QMacStyle::drawControl - lift the pool declarationTimur Pocheptsov2019-10-071-1/+1
| | | | | | | | | | | | | | | | | | out of switch/case - can help in case some NSControl is using autorelease and an application is calling drawControl too often. Fixes: QTBUG-78761 Change-Id: I2b55d533f52db16703dcc965920f4316fdf76734 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * QTextCodec: try to work around an ICC 19 bugMarc Mutz2019-10-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ICC 19 barfs on the TextCodecsMutexLocker class because it doesn't have a user-provided default ctor: ../../corelib/codecs/qtextcodec.cpp(543): error #854: const variable locker requires an initializer -- class TextCodecsMutexLocker has no user-provided default constructor [...] But the class doesn't have members that would delete the implictly-declared default ctor, so no user-provided default ctor should be necessary: The only member is the result of qt_unique_lock(), which is std::unique_lock, which does have a default ctor. We conclude that this is a compiler bug, and work around it with the introduction of a user-provided default ctor. Fix brace placement as a drive-by. Fixes: QTBUG-78844 Change-Id: I1f5a326afd68138fbebad506ba9aa1926f1afb85 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Vulkan: Add platform hooks before presentingJohan Klokkhammer Helsing2019-10-086-0/+29
| | | | | | | | | | | | | | | | | | | | This allows the Wayland plugin to circumvent the frame callback handling of the driver (which blocks until the frame is presented, potentially forever, if the window is minimized). Task-number: QTBUG-78000 Change-Id: Ia7d347019dfeae3bfcfad3d0cca3f4fffdc8c7a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Drop unused codeGiuseppe D'Angelo2019-10-071-16/+0
| | | | | | | | | | | | | | | | These defines are never used; maybe a remnant from Qt 4? Change-Id: Ieb12e629493e5483ca5ab84577569610eceb9417 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-0556-162/+302
|\| | | | | | | Change-Id: I554a2762890391b3b6013c8b82211a8386a4ced8
| * QSysInfo::prettyProductName(): Fix up dc042c6deea7e90b4a9dfcffdc33cbe61df421bdFriedemann Kleint2019-10-041-6/+5
| | | | | | | | | | | | | | | | | | - Fix indentation - Fix empty name returned for WinRT. - Remove duplicated string "Version" for Windows 10 Change-Id: Ia093006a6f8d8c88257d6b4e31afa37510dc6037 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * Fix build with QT_NO_CSSPARSER / -no-feature-cssparserNils Jeisecke2019-10-042-0/+30
| | | | | | | | | | | | | | | | | | Some parts of the new QTextDocument table border logic depend on the QCss namespace which is not available with -no-feature-cssparser. Change-Id: Ib8396894dc35872f22c634e1d6c38968d3dd4756 Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Include likely-adjusted uiLanguages for the system localeEdward Welbourne2019-10-045-18/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QLocale::uiLanguages() on the system locale uses whatever the system locale's query(QSystemLocale::UILanguages,...) returns. On Android, this is just a list of locales. However, for non-system locales, we also include some results of removing likely sub-tags from the locale name, where equivalent. Thus zh-CN would also get zh and zh-Hans-CN added to it; however, if the system locale is zh-Hans-CN, the shorter forms are omitted. So post-process the system locale list in the same way, albeit tweaked to avoid duplicates and rearranged so that we can insert likely-adjusted entries between what they adjust and what followed it. Added QLocalePrivate::rawName() in the process, since it looks likely to be useful in other contexts (and I needed its value): it just joins such tags as are non-Any. This, however, uses QByteArrayList, so added that (it's small) to the bootstrap library and qmake. This follows up on commit 8796e3016fae1672e727e2fa4e48f671a0c667ba. [ChangeLog][QtCore][QLocale] The system locale's UI languages list now includes, as for that of an ordinary locale, the results of adding likely sub-tags from each locale name, and of removing some, where this doesn't change which locale is specified. This gives searches for translation files a better chance of finding a suitable file. Fixes: QTBUG-75413 Change-Id: Iaafd79aac6a0fdd5f44aed16e445e84a2267c9da Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * CoreText: Use categorized loggingTor Arne Vestbø2019-10-041-4/+4
| | | | | | | | | | | | Change-Id: I4cfa6b0ef15adb7e600d66f4fe5b3dc17470f1c3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Remove CFBundleGetInfoString from Info.plist templatesTor Arne Vestbø2019-10-0414-36/+0
| | | | | | | | | | | | | | | | | | | | Is't been deprecated since Mac OS X 10.5. Task-number: QTBUG-74872 Change-Id: I8b1ad7aca6448883cb164fd0c4b329592ca60548 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>