summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* QMatrix4x4: restore NRVO in op*(M,M) 3/5: re-orderMarc Mutz3 days1-4/+4
| | | | | | | | | | | | | After de-coupling the first three lines of the 2D case from the following three lines in step 2 of this patch series, we can now re-order the lines so (the explicit) writes happen in memory order here, too, like in the 3D case. Amends 13b3545e833f6175f686c9776e1510db3f3f11eb. Pick-to: 6.11 6.10 6.8 Change-Id: I1f58a63032e610e64b6a214cb91ef1130c3b5662 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* gui: fix build with -qreal floatNick Shaforostov4 days5-10/+10
| | | | | | | | | | | | | | | in several places INT_MAX was implicitly converted to qreal. when qreal is float, the compiler warns: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion] the conversion is made explicit now also in qfontengine.cpp operands are reordered to let compiler pre-calculate part of the expression Pick-to: 6.11 6.10 6.8 6.5 Change-Id: I7cba0f95e38d10f661dca9f085cf024a6f8a5f52 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QMatrix4x4: restore NRVO in op*(M,M) 2/5: de-alias m and m1Marc Mutz4 days1-6/+6
| | | | | | | | | | | | | | | | | | | | In the 2D case, we first assign m1 to m and then multiply m2 into it. In the first three steps, we're using the fact that, at this point, and for the fields referenced, m is still the same as m1. This causes a dependency ordering of these three lines with respect to the following three lines, though, making it both harder to read for humans and harder to optimize for compilers. It also prevents us from writing to m in memory order. So don't read from m on the RHS, read from m1. Amends 13b3545e833f6175f686c9776e1510db3f3f11eb. Pick-to: 6.11 6.10 6.8 Change-Id: I8790974cb3337470d9359d09a943527a75f99527 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* a11y: Ensure std::memcmp works by adding member for unused State bitsMichael Weghorn4 days1-0/+4
| | | | | | | | | | | | | | | | | | | | | | Due to padding, std::memcmp wasn't guaranteed to return 0 even if all (bit)fields of the two QAccessible::State structs were identical. This was e.g. causing various of the state-related tests in tst_qaccessibility to fail in a Clang 21 build on Debian testing. Prevent randomness in the padding bits by making them explicit using an explicit `qt_reserved` member. All bits are already initialized to 0 in the ctor and now updating another field can no longer result in random values being written to the previously unreserved bits. Fixes: QTBUG-142463 Pick-to: 6.11 6.10 6.8 6.5 Change-Id: Id62866a688d8e8dd13143961b1a22f36cac09caa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QPageLayout: fix qFuzzyCompare() precondition violationsMarc Mutz4 days1-4/+4
| | | | | | | | | | | | | | | | qFuzzyCompare() requires that neither argument is numerically zero. This cannot be guaranteed for page margins. Fix by using the new QtPrivate::fuzzyCompare() function, which does things in the correct way. Amends 6c72080f26e9b70041434c6d762f7d601a2bf19c. Pick-to: 6.11 6.10 6.8 Task-number: QTBUG-142020 Change-Id: I3d925316a4934dd0a7ca98722299efabf63a43e4 Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QSizeF: clean up after port to QtPrivate::fuzzyCompare()Marc Mutz4 days1-4/+0
| | | | | | | | | | Amends edbe05d1e586e1860b2b5b68888c414300b008d9, which left the (now superfluous) -Wfloat-equal warning suppressions in, as well as a partial comment. Pick-to: 6.11 6.10 6.8 6.5 Change-Id: Ia45bcc8ab1367ed9bf0f6ff9d830eb258ca38dd0 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Initialize data members of QTcpKeepAliveConfiguration typeMarc Mutz4 days2-2/+2
| | | | | | | | | | | | | | | | | | | | | This is a simple struct, so default-initialization does not value-initialize. The backend expects "unset" values to be represented as non-positive values, so set everything to 0 for now. Thiago is on record to prefer storing the struct in an attributes map, and doing that would fix the issue, too, so this is just a stop-gap to fix the UB caused by reading these uninitialized values. Found by Coverity, which, for QHttpThreadDelegate, however, seems to have reused an older ID (it claims to have first detected this on 2024-03-21, when the code hadn't been written, yet). Amends 135ffa252eec87a396525fdac1b7deaad827ac0a. Pick-to: 6.11 Coverity-Id: 444259 Coverity-Id: 898575 Change-Id: Ib26cee1e8cf8303dd2330acb05a204b9ec59582a Reviewed-by: Mate Barany <mate.barany@qt.io>
* QtPrivate::fuzzyCompare(): fix a missing space in the static_assertMarc Mutz4 days1-1/+1
| | | | | | | | | | Amends edbe05d1e586e1860b2b5b68888c414300b008d9. Pick-to: 6.11 6.10 6.8 6.5 Task-number: QTBUG-142020 Change-Id: I6bb7a35fd29108ac4d46de61efff90205cd0eacb Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* q23:expected: namespace TL_ macros with Q23_Marc Mutz4 days2-156/+1070
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Guard our copy of tl::expected against use of a different version of the class in projects that use both. On the C++ side, we already did, by renaming the namespace from tl to q23. But macros are not namespaced, and the implementation doesn't clean up its many macros at the end of the file, so the alternative, simply undef'ing them at the end, doesn't work, because we can't rely on "the other version" to do the same. So grab the nettle and prefix _all_ TL_ macros with Q23_, incl., and in particular, the header guard, which might have caused FTBFS if a project was happily using tl::expected and Qt now injects q23::expected instead of tl::expected into the same header guard. Leave the 0005 patch slot free for an eventual amendedment of 4e9f4d5d02e29b4522540b8f9b9b01b7e57a6b54. [ChangeLog][Third-Party Code] Fixed potential compile errors in projects that use both the original tl::expected and Qt private headers. Amends 6f319847d01f6fa511397b83e267d6f7a56ff322. Fixes: QTBUG-142232 Pick-to: 6.11 6.10 Change-Id: Ib5762ec8ebe81e0c750da84be29531b7179c5025 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* JNI: document QJniObject's explicit exception handling featureVolker Hilsheimer4 days1-11/+65
| | | | | | Pick-to: 6.11 Change-Id: Idbee38ca81f3d65a8faf5daa7582ff63dc7204d9 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QRhiMetal: port away from QPairAhmad Samir4 days1-10/+12
| | | | | | | Pick-to: 6.11 6.10 6.8 6.5 Task-number: QTBUG-115841 Change-Id: Iddda475ac9f828f632f0e18842a721313d5b22fd Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* src/gui/text: port away from QPairAhmad Samir4 days5-9/+13
| | | | | | | Pick-to: 6.11 6.10 6.8 6.5 Task-number: QTBUG-115841 Change-Id: I0d5bd83090b951dc3b6b53c875404201823751dd Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* mimetypes: Avoid two system calls to open mimetype metadata fileDavid Edmundson4 days1-7/+9
| | | | | | | | Rather than calling QFile::exists before opening a file it's faster to just try and open the file and handle the error case. Change-Id: If45aedabcbf1c0ad76ce30c44bd7c278ffe1ffc3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMatrix4x4: restore NRVO in op*(M,M) 1/5: remove compound assignmentsMarc Mutz4 days1-6/+6
| | | | | | | | | | | | | | | | Replace them with the equivalent non-compound assignment, so we can, in a follow-up patch, replace the references to `m` on the RHS of the expressions with references to `m1`. This is the first step for porting the 2D case, like the 3D case, to Qt::Uninitialized, which, in turn is a prerequisite for re-enabling NRVO. Amends 13b3545e833f6175f686c9776e1510db3f3f11eb. Pick-to: 6.11 6.10 6.8 Change-Id: I8f32e413912f42f11aac4dcee4738d1b387c94d4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QMenu: return the triggered widget action from exec()Volker Hilsheimer4 days1-1/+5
| | | | | | | | | | | | | | | | | | | | A QMenu executed via QMenu::exec is expected to return the QAction that was triggered to close the menu. For QWidgetActions, this case is handled explicitly in the private _q_actionTriggered slot, as the mouse event is handled by the widget, and not by the menu. However, QMenu's mouse and key event handling was the only place where the current action got updated, and written also to the "syncAction" for menus opened synchronously. As a result, QMenu::exec returned nullptr if the menu was closed by triggering a widget action. Fix this by setting the current and sync action in the code that closes the menu when a widget action gets triggered. Fixes: QTBUG-141992 Pick-to: 6.11 6.10 6.8 Change-Id: Ie506b33dab8f9bd5b6fd54fd3fc91a107cbda64f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* wasm: draganddrop Make sure dropaction is correct in all casesEven Oscar Andersen4 days1-6/+12
| | | | | | | | | | | | | | | | | We do not necessarily run the functions in QWasmDrag, but might instead run the QSimpleDrag object. So we cannot rely on m_dragState->dropAction, but have to get the dropAction from QSimpleDrag. To make QWasmDrag work we call setExecutedDropAction in the cases where it is needed. Also, do not retry the drag operation if jspi && IgnoreAction. Fixes: QTBUG-142512 Change-Id: I2f1548db50a064033d1071a07cc42f1488610905 Reviewed-by: Lorn Potter <lorn.potter@qt.io>
* QWindows11Style: Increase size of QTreeView branching indicatorWladimir Leuschner6 days1-1/+1
| | | | | | | | | | | Increase the size of the branching indicator for treeviews from 6pt to 8pt. Fixes: QTBUG-142400 Pick-to: 6.10 Change-Id: I64ccd3a217f799d77233d6212f232af4e31d2ef1 Reviewed-by: Morteza Jamshidi <morteza.jamshidi@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* MetaObjectBuilder: add support for Virtual and OverrideDmitrii Akshintsev6 days2-0/+56
| | | | | | | | | Adapt MetaObjectBuilder to newly added property attributes. Task-number: QTBUG-98320 Change-Id: Ife1d388fd75939c730055746426dbf5459e170d8 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QMetaObject: Include a class def's hash in the meta objectOlivier De Cannière6 days10-12/+55
| | | | | | | | | | | | | | The hash has the following format <hash_revision>$<hash_b64>, where hash_revision is an integer and hash_b64 is the base64 encoding of the hash. MetaObjects built using QMetaObjectBuilder do not yet support the hash. That will need to be added at a later point. Task-number: QTBUG-142186 Change-Id: Ifafc7df2202decf48e8a1a45e652c2f61c5cea64 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* moc: Add the hash of a ClassDef to json outputOlivier De Cannière6 days1-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | Cpp code generated by qmlcachegen relies on stable metaobject layouts. They will, however, inevitably change in a incompatible way every now and then. This renders the cache files compiled with a previous version and stored on a user's machine invalid and unsafe to use. There is currently no mechanism to invalidate the cache files if a meta object breaks compatibility, by adding a signal for instance. To address this, we can record hashes of the meta objects a compilation unit relies on and invalidate it when a mismatch is found at runtime before executing it. We then fall back to other mechanisms to run the code. This first step adds the logic to compute the hash of a metaobject to moc and adds it to its json output. The hashes are of the form <hash_revision>$<base64_hash> Task-number: QTBUG-142186 Change-Id: Ifdd56b6259874024341a2b2623d088a45816b0a1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* moc: Extract mutating enumList manipulation from the GeneratorOlivier De Cannière6 days3-22/+22
| | | | | | | | | This allows for classList to be const from that point on and for the generator to only take a const reference to it. Task-number: QTBUG-142186 Change-Id: Ib43bfcb1a477a471b39c4b037d56f4dea42e04e7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuaternion: fix remaining qFuzzyCompare() precondition violationsMarc Mutz6 days1-4/+4
| | | | | | | | | | | | | | | | | qFuzzyCompare() requires that neither argument is numerically zero. This cannot be guaranteed for the quaternion elements. Fix by using the new QtPrivate::fuzzyCompare() function, which does things in the correct way. As a drive-by, put the operators at the beginning of continued lines, as requested by https://wiki.qt.io/Qt_Coding_Style#Line_breaks Item 2. Amends the start of the public history. Pick-to: 6.10 6.8 6.5 Change-Id: Ia317aa260ffc9fb04c10c24517a1ca3be58a1b05 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QVectorND: fix qFuzzyCompare() precondition violationMarc Mutz6 days1-8/+9
| | | | | | | | | | | | | | | | | | qFuzzyCompare() requires that neither argument is numerically zero. This cannot be guaranteed for the vector elements. Fix by using the new QtPrivate::fuzzyCompare() function, which does things in the correct way. As a drive-by, put the operators at the beginning of continued lines, as requested by https://wiki.qt.io/Qt_Coding_Style#Line_breaks Item 2. Amends the start of the public history. Pick-to: 6.10 6.8 6.5 Task-number: QTBUG-142020 Change-Id: I55cfb520bda53e12532923005bb1ee6396b124f2 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QMatrix4x4: fix qFuzzyCompare() precondition violationMarc Mutz6 days1-16/+16
| | | | | | | | | | | | | | | | | | qFuzzyCompare() requires that neither argument is numerically zero. This cannot be guaranteed for the matrix elements. Fix by using the new QtPrivate::fuzzyCompare() function, which does things in the correct way. As a drive-by, put the operators at the beginning of continued lines, as requested by https://wiki.qt.io/Qt_Coding_Style#Line_breaks Item 2. Amends the start of the public history. Pick-to: 6.10 6.8 6.5 Task-number: QTBUG-142020 Change-Id: Iadcf753cb756112c86923c62d8cf9a44a793ec8c Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QLastCursorPosition: fix qFuzzyCompare() precondition violationMarc Mutz6 days1-2/+2
| | | | | | | | | | | | | | | qFuzzyCompare() requires that neither argument is numerically zero. For a cursor position, this cannot be guaranteed. Fix by using the new QtPrivate::fuzzyCompare() function, which does things in the correct way. Amends 519e3963fad0761bac5629b1f6eabc58060265c0. Pick-to: 6.10 6.8 6.5 Task-number: QTBUG-142020 Change-Id: I994acabd644dc2838ecda39e159674fdc626cab9 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* wayland: Drop unused memberKonstantin Ritt6 days2-2/+0
| | | | | Change-Id: I809b68b9499de665276636b5a2c14300401e0ae9 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* QRM(A): Allow initializing a raw nullptr with an objectVolker Hilsheimer6 days1-9/+25
| | | | | | | | | | | | The ownership mess is not a problem if there's nothing stored at the position yet, and it allows gradually populating a row of raw object pointers. Hook newly inserted objects up to the autoConnectProperties mechanism. Add test case. Change-Id: Ie029a2a358e6a1ed5f24869039be9c2ad542dff9 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* macOS: Guard against missing platform window in viewDidChangeBackingPropertiesTor Arne Vestbø6 days1-0/+3
| | | | | | | | | | | | If the view outlives its platform window due to hanging around in some autorelease pool or strong reference we might get a callback for updated backing properties with no window to propagate them to. Fixes: QTBUG-137435 Pick-to: 6.10 6.8 Change-Id: I665d38f4fbed35f524cd46dfccdb885924cebd6c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Short live QtPrivate::fuzzyCompare()!Marc Mutz6 days4-19/+29
| | | | | | | | | | | | | | | | | | | | | Extract Method QtPrivate::fuzzyCompare() from the qFuzzyCompare() implementations that correctly validate the preconditions of the public qFuzzyCompare() (QMarginsF, QSizeF, QPointF), so we can more easily apply the same technique to other in-tree callers. In the process, replace comparison to literal 0.0 with calls to qIsNull() so we're a) insulated from -Wfloat-compare and b) have a customization point to extend to types other than float and double. Amends: - 473d06970d224b202e7a8ee8feaa2a2d98d5b257 (QMarginsF) - fa0d77e290f5ccb5afa7d02716f8726aa6b810e6 (QPointF) - 3ca9877f8cae41e1b1cb3c72d4a7872d97fb8254 (QSizeF) Pick-to: 6.10 6.8 6.5 Task-number: QTBUG-142020 Change-Id: Ib7ec06822f8006771a1c3a96145e98d574a29fbe Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QAbstractFileIconProvider: includemocsMarc Mutz6 days1-0/+2
| | | | | | | | | | Amends 476a5ff0ecd7b84066dc6fa9d85769ac108ffd1c, which made QAbstractFileIconProvider a Q_GADGET. Found in API-Review. Change-Id: I206f38918515fb3e06778051153e8af8ad8c068a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use quint32 for QRawFont::glyphCount() return typeTor Arne Vestbø6 days2-2/+2
| | | | | | | Aligns with the existing APIs in the class. Change-Id: Ia9f11138d93b37995c8084fd9a25070554cec7db Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Implement a backend of QIORing for WindowsMårten Nordheim6 days6-19/+851
| | | | | | | | | | | | | | | | | | | | | Using the IORing API on Windows to provide asynchronous I/O operations. Some parts supplemented by using some blocking API where we don't have an option (yet). Currently that just includes the 'stat'/size operation as well as Open and Close. Though with Close we schedule a flush and close the handle ourselves once the callback is invoked. The API is quite limited so far, but sufficient for what we have now. The implementation can be extended later as needed. The Vectored I/O operations are not actually vectored unfortunately, the Windows API requires page-aligned memory and sector-aligned file offsets, which makes it really impractical to provide generically. For a very limited time: limit the configure options to Windows 11. Task-number: QTBUG-136763 Change-Id: Iee57a23358a71ab6bfd007ff15b760b65ea76406 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* a11y uia: Notify about state changes of checkable item view itemsIngo Klöcker7 days1-2/+5
| | | | | | | | | | | To allow assistive technology on Windows to react to changes of the checked state of item view items send appropriate notifications also for the Cell, ListItem and TreeItem roles. Fixes: QTBUG-141856 Change-Id: I5ff341fa260ea95c0cf80bc25c141f9da0ea54da Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QRM: implement itemData in terms of multiDataVolker Hilsheimer7 days1-61/+23
| | | | | | | | | | | | | | No need to duplicate the entire logic. The only overhead is that we have to create a QModelRoleDataSpan for all roles, except our internal roles. Using a QVarLengthArray makes that cheap. The only special case we keep is for items that are backed by a type that is directly convertible to a QMap<int, QVariant>. This comes with a small overhead for acessing the element at runtime. Pick-to: 6.10 Change-Id: I33f86d231bef9036a7e83584d1bf013f129b8075 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* QRM: extract role check into helper and deduplicate reading codeVolker Hilsheimer7 days1-46/+47
| | | | | | | Amends e22cd01076e795ed853b0536605d3bb205587d78. Change-Id: If463efce1006a62c43bd85a7f1f9d913f806ad94 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* QRMA: clarify performance implications of accessing objectsVolker Hilsheimer7 days1-5/+3
| | | | | | | | | There is no performance difference between accessing mutable or const adapters, but in either case we are going to have to copy the value, as we go through QRM::data() to get a QVariant, which then stores a copy. Change-Id: I1712c3d87002b3650dcfee2900b0d00357695f11 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* QRM: add missing \since 6.11 to the autoConnectPolicy propertyVolker Hilsheimer7 days1-0/+1
| | | | | | | | The enum was already tagged, but the property was forgotten in f9bb6c8d900205375c70bb33f359ce0250212460. Change-Id: If52b4929f4548ba4603d8a565917afe624110522 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* QQuaternion: fix qFuzzyCompare() precondition violationMarc Mutz7 days1-1/+1
| | | | | | | | | | | | | | | | | | | | qFuzzyCompare() requires that neither argument is numerically zero. One user of this function cannot guarantee this, because, while they check for zero, they do so _after_ calling qFuzzyCompare() with that value, so the check comes too late. Fix by swapping the two checks around (so we check for == 0 before we check for == 1). Amends 8c1532eeaae6a220569cef3476d1124399478285, which changed from qFuzzyIsNull(x - 1) (which doesn't have the problem) to qFuzzyCompare(x, 1) (which does). Pick-to: 6.10 6.8 6.5 Task-number: QTBUG-142020 Change-Id: I054449b5510217f83479c5a028986c569f54084c Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QTextEngine: fix Coverity warning about overflowing an uintMarc Mutz7 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity complained that the while loop being changed by this patch overflowed last_cluster from its initial ~0u value in the post-increment operation. It's correct that we overflow, but the old code wasn't wrong: unsigned overflow is well-defined as mod 2^n, n = bit-width of the type, so we overflow to zero, but then, two lines further down, unconditionally overwrite said zero again. If we overflowed, that means that last_cluster was still at ~0u, so cannot possibly have compared < that `cluster`, another uint variable, so we couldn't get into the situation that the loop continues because of 0 < cluster. So this doesn't _need_ fixing, but in the spirit of "if Coverity doesn't understand it, a human won't, either", let's improve the code nonetheless. Observe that last_cluster is being used both as the loop counter as well as to hold the value across an outer loop. Separating the two roles by introducing a dedicated loop counter shows that this is just your typical run-of-the-mill for loop, so rewrite it as such. Amends c77222c0e711d584bec880222412fc50d044005f (5.3). Pick-to: 6.10 6.8 6.5 Coverity-Id: 898027 Change-Id: I8184bddc88e24a4a6612309ae59b64b99ca4c2d7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* mimetypes: keep track of whether extra mimetype existsDavid Edmundson7 days1-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | In the BinaryProvider backend each mimetype optionally has additional data in an XML file. For each mimetype this data is cached in m_mimetypeExtra. However, if a mimetype does not have any additional data this code returns early without caching anything. This causes an additional access and open call for every mimetype for each lookup of globPatterns. Given we have typically have hundreds of mimetypes and applications may need to look up thousands of files this becomes a very hot path that should not be making system calls after the first time. This patch should improve performance but not make any behavioural changes. All callers treat an invalid iterator the same as the default MimeTypeExtraMap. Change-Id: Ibe415ec4e70198655d7a6ad610664fe54e3b9215 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QMetaProperty: Introduce VIRTUAL, OVERRIDE attributesDmitrii Akshintsev7 days8-5/+76
| | | | | | | | | | [ChangeLog][QML] VIRTUAL and OVERRIDE attributes will be used for the expanded override semantics in QML. See QTBUG-98320 for the details. Task-number: QTBUG-98320 Change-Id: I56826a6b9158c0beeb58ad1564a58c22f15027bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* a11y: Notify about property/state changes of focused item view itemMichael Weghorn7 days2-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Item view item data for various roles are relevant for the properties and states reported for the corresponding accessible objects on the accessibility layer, see the a11y implementation in QAccessibleTableCell. Therefore, changes to the relevant role data should also be reported as corresponding state/property changes on the a11y layer. Implement sending corresponding accessibility events from QAbstractItemView::dataChanged. While the roles param in the QAbstractItemModel::dataChanged signal that this slot is connected to is optional, only handle roles that are explicitly passed for now, which covers the case of interactively modifying items. Properly handling the case of an empty list of roles indicating that all roles should be considered as (potentially) having been modified would require to keep track of previous values to be able to only send notifications about those that actually changed. (One way to do that for the current item could be to remember the values in QAbstractItemView::currentChanged and then compare whether those have changed in the meantime.) Always sending accessibility events even if no change actually occured would be incorrect and could e.g. result in confusing/misleading screen reader announcements. For now, in order to avoid potential negative performance implications when doing that for all items, restrict this to the case where (only) the current item's data has changed, which in particular covers the case where a user interactively modifies that item. (If the need arises, this can be further extended as needed in the future.) This e.g. makes the Orca screen reader on Linux announce changes to the checkbox state for the QTBUG-141856 sample program when toggling it using the space key, and results in the state getting updated as expected in Accerciser [1]. The accessible name shown in Accerciser also gets updated as expected when modifying an item's text, and Orca announces the new name. [1] https://gitlab.gnome.org/GNOME/accerciser Task-number: QTBUG-141856 Change-Id: Ic1592f4c639c29ab4144ae8b768f26c63f8878dc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* a11y: Unify item view to a11y child index mappingMichael Weghorn7 days7-12/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | Different QAbstractItemViewPrivate subclasses implement mapping from the item views model index to an accessible child index. So far, the methods implementing the logic were independent and used only within the corresponding item view implementations themselves. Introduce a new virtual base class method QAbstractItemViewPrivate::accessibleChildIndex and let the existing implementations override that one. This prepares for being able to make use of that logic directly inside QAbstractItemViewPrivate in an upcoming commit. While at it, also make have those methods dependent on QT_CONFIG(accessibility). Task-number: QTBUG-141856 Change-Id: Ic02a7875eccb893f722f13489f768f3675fe14bf Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Ingo Klöcker <dev@ingo-kloecker.de>
* a11y atspi: Drop unused QSpiAppUpdate and QSpiAppUpdateTypeMichael Weghorn7 days2-35/+0
| | | | | | | | | | | | | | | | | These have been unused ever since they were introduced when the AT-SPI2 bridge was added in commit 8e1ff45e74f529c7f49688242ea0fd25ce2913f3. They also don't seem to correspond to anything in the AT-SPI2 XML specifications or anything else in the at-spi2-core repo [1]. Drop them. [1] https://gitlab.gnome.org/GNOME/at-spi2-core/ Change-Id: I9e02db434eb06279b7393061f4796ad3da7f4d1e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* a11y - Allow headers to be fetched by QAccessibleTable::cellAtEven Oscar Andersen7 days1-0/+31
| | | | | | | | | We are going to need this later when we need the geometry for the visible cells. Task-number: QTBUG-141125 Change-Id: I6c12640405d902b84f241dadb4b4fe988535af0a Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QFlatMap: restore NRVO in do_take()Marc Mutz7 days1-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The usual problem, the usual solution... At the time of construction of the return object it is known which of the two variables to construct, so NRVO would be permissible, but most compilers don't enable it because the structure isn't T result; // first (non-trivial) variable declared // must be a function's top-level scope ~~~ return result; // only one // or else all return statements are token-by-token the same The usual fix is to wrap the tail part of the function (= the one that constructs a T and returns it, as opposed to the part that returns temporaries) in an IILE expression: the lambda then _has_ said structure, so is NRVO'ed and the call to the lambda is RVO'ed in the caller. Invert the polarity of the if statement in order to keep the meat of the function's git history intact. Amends deddafe0a6a32aa438cc36c7dcfae8c323274487. Pick-to: 6.10 6.8 Change-Id: I3f22665daca320be283e4088cf1062f115cd49e4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFlatMap: avoid mixing rvalues and lvalues in the ternary operatorMarc Mutz7 days1-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As pointed out by Coverity elsewhere¹, use of a ternary in return statements can sometimes lead to superfluous copies, because lvalues are forced to materialize an rvalue when they appear together with an rvalue in the resp. other leg. I'm pretty sure that's the case here, because it.value(), while being an lvalue, returns a reference-to-const, so isn't a local object that would enjoy a transparent move, anyway. But by rewriting the code as an if statement instead of a ternary expression, the reader doesn't need to understand the issue (if they are aware of it in the first place): the 'return T()' is definitely RVO'ed, and the return 'it.value()' definitely calls the copy constructor. As the result isn't worse in executable speed, but easier to reason about, do the rewrite. Amends deddafe0a6a32aa438cc36c7dcfae8c323274487 for the original value() and 64bc6509c350c5750c6432a0ae6876f4bfb97cd0 for the is_transparent case. ¹ e.g. cd96362492375c50a9d0614b829c51eb6597d713 Pick-to: 6.10 6.8 Change-Id: Id8b3bc31e0f38ea961cfe6169e68b1b4744c799f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update bundled libpng to version 1.6.52Eirik Aavitsland7 days11-63/+82
| | | | | | | | [ChangeLog][Third-Party Code] libpng was updated to version 1.6.52 Pick-to: 6.10 6.8 6.5 5.15 Change-Id: I83a6e349ac0d1d83966a118c1c959d0e8c99b371 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* a11y - Send ObjectDestroyed for interfaces without objectsEven Oscar Andersen7 days1-2/+21
| | | | | | | | | Interfaces without an object calls deleteInterface directly, issue ObjectDestroyed events also in this situation. Task-number: QTBUG-141125 Change-Id: I0dc7ff5e45a5fe61af01957eb4c8088cc2e64e17 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* xcb: check exactly the first bit of XdndStatus flags in QXcbDragYixue Wang7 days1-1/+1
| | | | | | | | | | https://www.freedesktop.org/wiki/Specifications/XDND/#clientmessages Client Messages->XdndStatus->data.l[1]: Bit 0 is set if the current target will accept the drop. Pick-to: 6.10 6.8 Change-Id: I6978f99f55d57c8025cc644ef837af154f44e7a8 Reviewed-by: Liang Qi <liang.qi@qt.io>