summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* QLocalSocket/Win: do not flush the pipe in disconnectFromServer()Alex Trotsenko2021-07-242-1/+19
| | | | | | | | | | | | | | | | | | In the case where we have pending data to write, calling flush() here may cause the device to close immediately, if the pipe writer already got a result of the last operation from the thread pool. In this scenario, the device does not enter the 'Closing' state, which leads the following code to unexpectedly fail on Windows socket.write(...); socket.disconnectFromServer(); QVERIFY(socket.waitForDisconnected()); Removing the call to flush() makes the behavior consistent with the implementation on Unix. Change-Id: Ic31fbc999be979c1e5befa8f132d9fb367f472ca Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket: call abort() instead of close() on destructionAlex Trotsenko2021-07-243-13/+9
| | | | | | | | | | | | The QLocalSocket destructor should immediately close the connection and destroy the socket, clearing any pending data in the write buffer. The abort() call ensures that the pipe is destroyed on Windows, making the additional call to destroyPipeHandles() from the private destructor unnecessary. Change-Id: Ic7a0d8cf2779cd933cded864c8bab0d096469499 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket/Win: remove unnecessary call to setWriteChannelCount()Alex Trotsenko2021-07-241-1/+0
| | | | | | | | | | We no longer use the QIODevice's internal write buffer. This patch amends 5b78d7fdcf9b758f117eaa65dc5eeddd0d4557e0 . Change-Id: Ife5a6ba3c2216d5a3e0a8278da98e0a36886d765 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket/Win: remove dead code in disconnectFromServer()Alex Trotsenko2021-07-241-8/+0
| | | | | | | | | The _q_pipeClosed() slot unconditionally removes the pipeWriter just before closing the pipe. Thus, if we have an invalid handle here, the pipe writer has already been destroyed anyway. Change-Id: I57463d8464afe6141c21a63851a56ebddabd3f13 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QLocalSocket/Unix: fix aborting the socketAlex Trotsenko2021-07-243-0/+8
| | | | | | | | | | | | | | | | | | According to the documentation, calling abort() should immediately reset the socket to its initial state. This includes: - closing the file descriptor; - closing the QLocalSocket as an I/O device; - canceling a pending outgoing connection, if it exist; - reseting 'serverName' string. So, adding a call to close() resets the state entirely. Pick-to: 6.1 6.2 Change-Id: I9c604b5187c6300b437d7aa4c2d06db03edacf21 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QWidget: cope with QObject::connect()'s incomplete SFINAE-friendlinessMarc Mutz2021-07-243-24/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The plan for QObject::connect() (perfect) forwarders, such as QWidget::addAction(), was to just use a variant of the Detection Idiom to see whether QObject::connect() with the arguments as given would compile and SFINAE out the forwarder otherwise. It turns out that the "functor" overload of QObject::connect(), in particular, is severly underconstrained and accepts e.g. QKeySequence as a function object, only erroring out via a static_assert() in the body of the function, and thus at instantiation time and not, as needed, at overload resolution time. At the same time, we don't really want QObject::connect() to SFINAE out on argument mismatches between signal and slot, because the resulting error messages would be ... unkind to users of the API. We would like to keep the static_assert()s for easier error reporting. Reconciling these two contradicting requirements has so far eluded this author, so for now, to unblock progress, we explicitly black- and, in one case, white-list possible arguments. Because QKeySequence, in particular, is implicitly constructible from int(!), and therefore any enum type(!), incl. Qt::ConnectionType, we need to do way too much coding in the addAction() constraints. Hopefully, we'll be able to fix the issue at the root cause, in QObject, before Qt 6.3 is out, but until then, this is an ok-ish stop-gap measure. Add thorough overload set checks (positive ones only, for now) to tst_qwidget and tst_qmenu. Change-Id: Ia05233df818bc82ecc924fc44c1b349af41cbbf1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Use namespaced variables in Qt6*Dependencies.cmakeLi Xinwei2021-07-245-99/+98
| | | | | | | Pick-to: 6.2 6.1 Change-Id: I166988020cfd9750a4d58e519742215d0c03ad3e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Purge empty methods from tst_QSqlRecordEdward Welbourne2021-07-231-17/+0
| | | | | | | There's no point mentioning empty init(), constructor and destructor. Change-Id: I0b820f62fd46a955aae891adfc68ca366ca60672 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Select PostgreSQL-only data, rather than filtering in the testEdward Welbourne2021-07-231-19/+17
| | | | | | | | | | | | Two QSqlRecord benchmarks that are only relevant for PostgreSQL were being run for all backends, without producing useful results for the others. Since the test is data-driven and the generic data-table code can take a backend-name to decide which to include, pass a suitable string to the generic data method instead, so that we now simply skip these tests (and say we're doing so) rather than "passing" them. Change-Id: I2223c16007a7095a9cadd13a9b2d46813507a35f Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Rename QSqlRecord benchmark's source file to match its test nameEdward Welbourne2021-07-232-2/+2
| | | | | Change-Id: I580f185b3bbe283dfa2f43bbc986233d01219814 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Make QSqlRecord benchmarks non-fatuousEdward Welbourne2021-07-231-2/+6
| | | | | | | | | | | | | | Because QBENCHMARK re-runs its block repeatedly, to get sensible data, the block needs to actually do something when repeated. Since these tests had blocks that looped while (qry.next()), they left qry at its end state, so such repeats tested nothing. Use seek(0) at the start of each cycle to actually do the work repeatedly when the block is repeated. As a drive-by, split a long line. Pick-to: 6.2 6.1 5.15 Task-number: QTBUG-91713 Change-Id: Id46f77dc5e71335871af79ff61e1980b5f636179 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Halve the data-set size of tst_QSqlRecord::benchmarkRecord()Edward Welbourne2021-07-231-1/+2
| | | | | | | | | | At 1000, the set-up was taking longer than the five minutes QtTestLib's WatchDog allows, so the test got killed. Pick-to: 6.2 6.1 5.15 Task-number: QTBUG-91713 Change-Id: Ia3c85b223fc917ad5817364505cbffe50d67ddc6 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Convert QLocalSocket benchmark to use QTestEventLoopEdward Welbourne2021-07-231-10/+17
| | | | | | | | | | | Now that this event loop pays attention to test failures, we can avoid the time-outs that used to happen on test failure. Also check for premature failures (but don't return early, so we can shut down the server gracefully) and give the event-loops sensible time-outs. Task-number: QTBUG-91713 Change-Id: Ib895a5fba0f22654c7fecf996f23649a4b5ce0de Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
* Assert some more things we can be sure of in the QMap benchmarkEdward Welbourne2021-07-231-0/+17
| | | | | | | | | Just in case the test isn't testing what we think it is. One of my earlier changes didn't until this told me about it. Change-Id: Idd6f415d543509cabb3a64219736bb43e60a70ef Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QMap benchmark: use unsigned accumulators and check themEdward Welbourne2021-07-231-4/+12
| | | | | | | | | | | | | | | | | | | The sum of the first 100000 naturals is more than 2^32, so using an int accumulator to collect the values is susceptible to overflow, which is UB for signed integral types. So switch to an unsigned type. We don't care about the actual sum, only having the various map entries we fetch "used". Since unsigned arithmetic is well-defined even when it overflows, we can calculate the expected sum and verify it, to ensure that no matter how clever the optimizer, it won't throw out the accumulator as written but not read (and then optimize out all the tested code). As a drive-by, rename one of the accumulators to match the rest. Change-Id: I93a2825247c96ca88fe52fdb7ce1e5456eebad54 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Rename QMap benchmark source file to match test nameEdward Welbourne2021-07-232-2/+2
| | | | | | | | s/main/tst_bench_qmap/g Change-Id: Ic520254f5b5f946f4eaa234352317749a9a7301f Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Give symbolic names to the sizes of data-sets tested in QMap benchmarkEdward Welbourne2021-07-231-24/+27
| | | | | | | | | Mostly so that I can put comments on them to indicate why some tests are bigger and others not so big. Change-Id: I633ceb264aa96ee8f5345e3f342a518e8ae4838b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Remove special casing of HSL QColor comparisonAllan Sandfeld Jensen2021-07-231-12/+3
| | | | | | | | | | | | | All other equality comparisons except floating-point are value comparisons, not interpretation comparisons. [ChangeLog][QColor] Equality on HSL colors is now raw value based like other color-formats, instead of being partially interpretation based. Pick-to: 6.2 Change-Id: I391464da172af6a2d69178b94203d36f7ce2c07d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* doCrypt() - check the error codesTimur Pocheptsov2021-07-231-1/+7
| | | | | | | | | Disabled (moved into the legacy provider) DES-CBC results in a crash, when setting key length. Pick-to: 6.2 6.1 5.15 Change-Id: Ie0b49424f11d8042ebecebfd3b6346263f730551 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMenu: actually deprecate all trailing-shortcut addAction() overloadsMarc Mutz2021-07-231-0/+4
| | | | | | | | | | The templated ones were forgotten. Amends 09d1196281ccd03dac55781ac91f6c4eb7bb4de9. Change-Id: I042f25be814fc38e681acfe655124a66e78a1045 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Ensure deprecated APIs in Qt Core are documented as suchNico Vertriest2021-07-2310-71/+55
| | | | | | | | | | Added \deprecated [version_since] when needed Remove references to deprecated functions in \sa statements Fixes: QTBUG-94534 Pick-to: 6.2 Change-Id: I3b3d4277d63fc5d6d207c28ff2484aed30b83247 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make QFutureWatcher::isFinished() consistent with the watched QFutureSona Kurazyan2021-07-233-32/+52
| | | | | | | | | | | | | | | | | | | | | All the getters of QFutureWatcher are consistent with the getters of the corresponding QFuture, except for the isFinished() method, which returns 'true' only after the finished() signal is delivered. This behavior might be unintuitive for the users. In particular, isFinished() returns 'false', even if it's called immediately after waitForFinished(). [ChangeLog][QtCore][QFutureWatcher][Important Behavior Changes] The QFutureWatcher::isFinished() method now indicates if the related QFuture is finished, instead of indicating if the finished() signal was delivered. This makes it consistent with the future that is being watched. Fixes: QTBUG-91048 Pick-to: 6.1 6.2 Change-Id: I6ae9b882b23e06198a82c95b026491bd480b3bf0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add benchmarks for QString::numberMårten Nordheim2021-07-222-3/+133
| | | | | | | | | While we're here: - remove the GCC precondition for compiling this benchmark. Task-number: QTBUG-88484 Change-Id: I14f3ea7e4708e274d032a6297e9d4a87ae5dc1c0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QTextCharFormat: mark a couple of API mistakes to be fixed in Qt 7Giuseppe D'Angelo2021-07-222-0/+40
| | | | | | | | | | | | | | | The fontFamilies and fontStyleName have an asymmetric getter and setter. The setter takes QStringList, but the getter returns QVariant (?), for no reason whatsoever (the underlying QFont APIs take QStringList, and the docs say that they should return QStringList). It's not entirely obvious that we can fix this without introducing badly-named getters (getX) or somesuch, so for the time being, mark this to be fixed in Qt 7. Change-Id: I49706af00906a2c5d950ada4be3cbc76dbee432c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* Use QChar::fromUcs4(i) rather than QChar(i) on out-of-range iEdward Welbourne2021-07-221-16/+28
| | | | | | | | | | | | | | | | | | | Follow-up to commit 915be6606ead25f4fbbbcb2687b33cf22a955177, catching some benchmarks that took for granted they can assign an arbitrary int to QChar. Since 6.0 this has triggered an assertion. Given the choice between limiting the range (from 100000 to 0x10000) and actually handling the out-of-range values as UCS-4 data, the latter seemed like a more interesting test. At the same time, take the construction of the strings out of the loop, as that's not a QMap performance matter, it's a QString one. Pick-to: 6.1 6.2 Task-number: QTBUG-91713 Change-Id: Id6abab08b5c879f0f764350f66d6aa1dd9f1620a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Remove some now-redundant casts to qint64Edward Welbourne2021-07-221-8/+3
| | | | | | | | | | | | | One was long redundant. The other two, relatively recently added, should be redundant thanks to the former enum member MSECS_PER_DAY being changed to a constexpr qint64 by commit 4059af81d33bb1f6a7773b77d3039f2fc53fcd23 Change-Id: I601ed8dae905fed6399ce29c25545ec651e9838a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Sync default action when checking tool button programmaticallyVolker Hilsheimer2021-07-222-0/+65
| | | | | | | | | | | | | | | | | | | | | | QAbstractButton::setChecked is not virtual, so QToolButton cannot override to synchronize the default action's checked state. This resulted in button and default action not being in sync when the checked state of the button was changed programmatically, while changing the checked state on the action kept the button in sync. Connect to the button's own toggled signal instead to keep the state of the default action in sync. Make it a unique connection to allow multiple calls to setDefaultAction, which are used by QToolButton to keep the button updated if properties of the default action change. Add a test that confirms that button and action are synchronized both ways, and that we only get single signal emissions when changing either programmatically. Fixes: QTBUG-95255 Pick-to: 6.2 6.1 Change-Id: I0e027faf1da763ef1878e46e85bfa70073c8bf82 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QSet: extend testsIvan Solovev2021-07-221-5/+172
| | | | | | | | | | | Extend tests to explicitly check the behavior of empty default-constructed container. Also add some missing tests to increase the code coverage. Task-number: QTBUG-91736 Pick-to: 6.2 6.1 Change-Id: Ie57b5d13fad9a846c29c87be4985c87e69bba305 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QColorSpace: Guard against division by zeroRobert Löhning2021-07-221-5/+9
| | | | | | | | Fixes oss-fuzz issue 35547. Pick-to: 5.15 6.2 Change-Id: Ida0b92ab17548f359d8634114bbdeb4c9d3a8dc8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QString: extend unit testsIvan Solovev2021-07-221-74/+495
| | | | | | | | | | | | | | | | This patch introduces some test improvements to check the calls of different methods on an empty default-constructed string. Apart from that, some other tests are added to extend code coverage. As a drive-by: * fix int -> qsizetype in the test data * fix int -> enum in the test data Task-number: QTBUG-91736 Pick-to: 6.2 6.1 Change-Id: I159473b7f5dcbea1bdaf2966979e066296351208 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* CMake: Disable test_QT_TESTCASE_BUILDDIR cmake build testAlexandru Croitor2021-07-221-4/+8
| | | | | | | | | | | | | | | | | | | | | CMake 3.21.0 + Ninja now pass absolute source file paths to the compiler which causes __FILE__ to be absolute and qFindTestData to ignore any QT_TESTCASE_BUILDDIR value. This causes the test to fail, because it won't find test data in the custom specified location. Disable the test for now. Amends 70464b355ec1c7007e0b1291f733e2540ba1825f Pick-to: 6.2 Task-number: QTBUG-95268 Task-number: QTBUG-95018 Change-Id: If99035e897ac1d5f153d4e19c94e4355f88970af Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Fix Windows -debug-and-release builds with CMake 3.21.0Alexandru Croitor2021-07-221-5/+19
| | | | | | | | | | | | | | | | | | | | | CMake 3.21.0 introduced a regression where per-config sources can't be specified for object libs when building Qt with Ninja Multi-Config and cross-config mode on. We hit that in our Windows resource compiler handling. To work around the issue, pass the config-specific sources directly to the target rather than via an object library, when using CMake 3.20 or later. The original issue of not being able to do that has been fixed in 3.20. Amends ba6175eb731927f2489cdd7d899616a9889aba67 Amends a1ccedeb440216dce87fad01746935a89fd8715e Amends 657fa0462d552110e2ba14bcac46275e6066993f Pick-to: 6.2 Fixes: QTBUG-95229 Change-Id: Idea6d5bcc54b3124c66c45538c2e06e92f288f5f Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Fix Windows resource compiler failure in selftests with MinGWAlexandru Croitor2021-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The MinGW resource compiler fails to handle compile definitions with multiple values. When the resource file is compiled as part of the main target rather than a separate object library, the resource generation rule will inherit all the compile definitions from the main target. For the case of tst_selftests this causes errors like gcc: error: badxml\: No such file or directory gcc: error: benchlibcallgrind\: No such file or directory gcc: error: benchlibcounting\: No such file or directory gcc: error: benchlibeventcounter\: No such file or directory gcc: error: benchliboptions\: No such file or directory Limit the compile definition to the C++ language only, so the multiple values are not passed to the resource compiler. Pick-to: 6.2 Change-Id: Ie53666839272556323b50d79c090f0dc71745d11 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Android: stop making throwing promisesGiuseppe D'Angelo2021-07-221-25/+1
| | | | | | | | | | | No Qt API throws exceptions, ever. Kill the throwing paths, leaving the normal paths in which a permission request is denied. Pick-to: 6.2 Change-Id: I6bebaf155c5232444bf5014e25e9c469d5dccfa6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Fix incorrect default plugin conditions on WindowsAlexandru Croitor2021-07-222-2/+2
| | | | | | | | | | | | | | The correct variable to check is WIN32 rather than WINDOWS. This affects which plugins get automatically linked in a static Qt build. Amends a3b58a7844f77bd416fad8307f8333ff7c0efacf Amends d385158d5213ef568b7629e2aa4a818016bbffac Pick-to: 6.1 6.2 Fixes: QTBUG-95283 Change-Id: Idf78c78a1029f4d13fb460c07bef3d2669e55b09 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Ensure deprecated APIs in Qt Sql are documented as suchNico Vertriest2021-07-222-20/+19
| | | | | | | | | Added \deprecated + [version_since] where needed Fixes: QTBUG-94585 Pick-to: 6.2 6.1 Change-Id: Id6d1fee1bbb6f8194e90a494673edef34530482b Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Don't slow down a QMap benchmark by growing a megabyte-long stringEdward Welbourne2021-07-211-1/+1
| | | | | | | | | | | | | | Change a += to simple assignment where it's string arithmetic (a hundred thousand concatenations of "Hello World" add up to more than a megabyte, in an incremental growth that's going to dominate the QMap operations we were meant to be benchmarking) and the only reason for it is to avoid an unused result warning. Accumulating int values is harmless, but strings are another story ! Pick-to: 6.1 6.2 Task-number: QTBUG-91713 Change-Id: Ib0dc131b0cc75fea23998afc0300e8cb60076c7e Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QSet::erase - extend docsIvan Solovev2021-07-211-0/+5
| | | | | | | | | | | | | Explicitly specify that calling this method for an empty set or with an invalid iterator results in undefined behavior. On a debug build an assert is triggered in such case, but on a release build it will access the incorect index of an array. Task-number: QTBUG-91736 Pick-to: 6.2 6.1 Change-Id: Ibc3e91512a0ad9d9779a41083fedb8a91780380b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QFileSelector: Preserve path to root directoryFabian Kosmale2021-07-212-1/+7
| | | | | | | | | | | | | | | | While QFileSelector is documented to work on files, select accepts arbitrary URLs. Moreover, the QML engine can end up intercepting arbitrary (user provided) URLs, including to directories. Prior to this change, passing "file:///" or "/" to the function would break: We would temporarily get a "//" path, which is invalid, and thus we would return an invalid in the end. Prevent this by only appending a slash to the path when it doesn't have one. Fixes: QTBUG-85410 Pick-to: 6.2 Change-Id: I1d2807a9d225df611c3a5e871e3c1d90a6a25953 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QString benchmark: rename the source fileMårten Nordheim2021-07-212-2/+2
| | | | | | | 'main.cpp' is quite generic when using search to look for it. Change-Id: I547ba16a11db8efb7d4410b94343b03d30da6513 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Update deprecated NSAccessibility methodVolker Hilsheimer2021-07-211-1/+1
| | | | | | | | | | | accessibilityEnabledAttribute is replaced with isAccessibilityEnabled. https://developer.apple.com/documentation/appkit/nsaccessibility/1535024-accessibilityenabled?language=objc Fixes: QTBUG-95293 Pick-to: 6.2 6.1 5.15 Change-Id: Ie88fa61ad97d6c77dcec15e63a73f64c90011497 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Prevent array-out-of-bounds accessVolker Hilsheimer2021-07-211-1/+5
| | | | | | | | | | | | | | | Fixes static analyzer warning 12b19393e18b2394a398806f633c6eee, and amends a1a6e3d21b1a4fb799dfd245fed6bb6564178894. In the process, replace the "int& *= double" with correct integer arithmetic that'll produce the intended result without going via double. Done-with: Edward Welbourne <edward.welbourne@qt.io> Pick-to: 6.2 Task-number: QTBUG-8096 Change-Id: Ib2aa8ae46a1bfd4d121e61cf99141c0311502215 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix QtConcurrent to properly work with functorsSona Kurazyan2021-07-215-278/+522
| | | | | | | | | | | | | | | QtConcurrent reduce functions were requiring to explicitly pass the the result type when passing functors as reductor. This was because of inability to deduce the result type from the functors. The result type of the QtConcurrent reduce functions should match with the type of the fist argument of the operator() when a functor is passed. Reused the ArgResolver type trait (already used for QFuture and QtConcurrent::run) to find out the result type in that case. Task-number: QTBUG-88448 Change-Id: Ief0eeee197df8cb9c30f3403d71978f36e4fb0f2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* emit layoutAboutToBeChanged timelyLuca Beldi2021-07-2012-17/+492
| | | | | | | | | | | layoutAboutToBeChanged must be called before persistentIndexList as the user might create persistent indexes as a response to the signal Fixes: QTBUG-93466 Pick-to: 6.2 5.15 Change-Id: I73c24501f536ef9b6092c3374821497f0a8f0de4 Reviewed-by: David Faure <david.faure@kdab.com>
* QNetworkReply: Add two new signalsMarkus Goetz2021-07-2013-0/+183
| | | | | | | | | | | These signals allow monitoring where in the HTTP1/HTTP2 flow a request is currently in. Fixes: QTBUG-71698 Fixes: QTBUG-18766 Change-Id: Icc2fe435afc9f680fa7a76c32731e25fcdfeb4b4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix lcTlsBackend redefined in several places (plugins, static build)Timur Pocheptsov2021-07-209-55/+48
| | | | | | | | With -static build lcTlsBackend was duplicated. Pick-to: 6.2 Change-Id: I20ee0f9c7e2027a7033c9fbae628d0d91672e719 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Schannel: Fix ODR violation in static programsMårten Nordheim2021-07-203-39/+58
| | | | | | | | | The Q_LOGGING_CATEGORY macro defines a function, and for each backend the function would be defined (and defined differently). Pick-to: 6.2 Change-Id: I6522b5e3baf731e5ead0e21da009c970d580fa02 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_QSslSocket: fix and clean up allowedProtocolNegotiationMårten Nordheim2021-07-201-10/+4
| | | | | | | | | | | The server's socket may not have been created yet, so use the server's signal instead. Switch to QCOMPARE to get better output. Delete the extra checking for schannel, we don't support Windows 8 anymore. Pick-to: 6.2 Change-Id: Icd310c32939cb577c9f3438789f667aa0a3a4d85 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Scale image with MDI icons using the correction factorVolker Hilsheimer2021-07-201-2/+2
| | | | | | | | | | | | | | | The buffer might be large than needed and contain a lot of uninitialized pixels. Scaling it down to the requested size is wrong, we need to scale it by the correction factor. Amends e56b8e1e59b6df7c7abd48b163abe6846849eb7a. As a drive-by, make the correction factor helper function static. Fixes: QTBUG-94733 Pick-to: 6.2 6.1 5.15 Change-Id: Ia5be2a77459321e30485d330b49cf57fdbb664d2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QNetworkDiskCache: Fix tracking of size during storeItem()Mårten Nordheim2021-07-202-13/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | If the file already existed we simply removed the old one without adjusting the size. So use the removeFile() function which takes care of that. Additionally, if the current size was non-null we previously increased the size (presumably meant to be temporarily but wasn't) and called expire() which would either: 1. not do anything and return currentCacheSize, if it was not greater than the max size. This would mean that the size of the file would be counted twice. or, 2. discard currentCacheSize, measure the size of the items, and then remove some items if the total size surpassed the max cache size Neither of those branches need us to (temporarily) increase currentCacheSize. It also doesn't attain the (presumed) goal of trying to keep below the max cache size after having added the new item. Fixes: QTBUG-95009 Pick-to: 6.2 6.1 5.15 Change-Id: I2b5b13ff473a7aa8169cf2aecfea783c97f2d09a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>