summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* QMainWindowLayout::animationFinished(): don't show deleted tab barsAxel Spoerl12 days1-2/+4
| | | | | | | | | | | | | | | | | | | | | QMainWindowLayout::animationFinished(): looped over a copy of the usedTabBars member and showed all tab bars in the container. Showing a tab bar, can cause another in the container to become unused. Unused tab bars were kept in a separate container and re-used, before a3f0ce4c0d0627ef979052b34b21e6fd2bdc3acf changed this logic and deleted unused tab bars. This caused a regression: show() was called on a deleted tab bar, causing a crash. Only show tab bars from the copied container, if usedTabBars still contains them. Fixes: QTBUG-138201 Pick-to: 6.10 6.9 Change-Id: I33de57ab3276d1f786d27f63aebfe8ba8ddc2832 Reviewed-by: Samuel Gaist <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* gui: Add missing QAPP_CHECK undefines to fix unity buildsTim Blechmann12 days2-0/+4
| | | | | | | | | QAPP_CHECK is defined in multiple cpp files. It should be undefined in the end to prevent unity build failures. Pick-to: 6.10 Change-Id: If01791a4022c88714aab2b798a70195c5b6a8613 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Android: Set proper A11y-element java class names to support TalkBackLars Schmertmann12 days2-7/+132
| | | | | | | | | | | | | | | | | TalkBack can provide useful additional information such as element specific interactions, positions or counts. In order for this to work, the AccessibilityNodeInfo.getClassName() method has to provide names to actual Android UI classes. So based on QAccessible::Role we provied these class names. [ChangeLog][Accessibility][Android] Provide actual Android UI class names for TalkBack to improve a11y announcements. Fixes: QTBUG-137806 Pick-to: 6.10 6.9 6.8 Change-Id: If7746516eb6eaf03525906f08daed5b93478beff Reviewed-by: Lars Schmertmann <[email protected]> Reviewed-by: Assam Boudjelthia <[email protected]>
* Increase timeout for copying test logMatti Paaso12 days1-0/+2
| | | | | | | Pick-to: 6.10 6.9 6.8 6.5 Task-number: QTQAINFRA-7268 Change-Id: Idf847ccd4205edc30c174a39535e11c3c39f5bb5 Reviewed-by: Jukka Jokiniva <[email protected]>
* CMake: demote -Wnullability-completeness to warning for unity buildsTim Blechmann12 days1-0/+12
| | | | | | | | | | | | | Unity builds currently fail on macos with -Werror, due to -Wnullability-completeness. It seems that apple's system headers don't have every NS_ASSUME_NONNULL_BEGIN followed by a NS_ASSUME_NONNULL_END, which seems to leak into our code. Demoting the errors to a warning to make -Werror builds pass again. Pick-to: 6.10 Change-Id: I70d8ae33bf57b87feac7bb33b929b74f8cd60504 Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Alexey Edelev <[email protected]>
* android: fix unity buildsTim Blechmann13 days1-0/+5
| | | | | | | | | Q_DECLARE_JNI_CLASS leaks declarations into other translation units. To make unity builds work, we exclude some cpp files. Pick-to: 6.10 Change-Id: I572b61ee257ef44a4164fec9ac3e6bbec1c196e2 Reviewed-by: Assam Boudjelthia <[email protected]>
* QtTest LoggerRegistry: fix UB (default-constructed std::atomic)Marc Mutz13 days1-1/+1
| | | | | | | | | | | | | | | | | Up to C++17 inclusive, a default-constructed std::atomic object can only be initialized using std::atomic_init(), _not_ by .store(). While __cpp_lib_atomic_shared_ptr is a C++20 feature, when std::atomic default construction has been fixed, compilers may implement these feature in any order, and it's not much work to call the std::atomic<T>(T) ctor in NSDMI instead of the default constructor, so do that. Amends a0303cc7c590ff17fb5b0a5975bff98669e42942. Pick-to: 6.10 6.9 6.8 Change-Id: Id3148db0049ee4e16509c2bfd78c9f9ee145f269 Reviewed-by: David Faure <[email protected]>
* QtTest LoggerRegistry: fix UB (insufficient atomic memory order)Marc Mutz13 days1-4/+4
| | | | | | | | | | | | | | | | | | | The code load()s the shared `loggers` to iterate over it (or copy from it) (= read the memory pointed to) and it store()s the shared `loggers` after intializing it (= writing to the memory pointed to). So relaxed loads and stores are not sufficient here. Stores must have release memory order and loads acquire memory order, otherwise the writes before the store() will not happen-before the reads after the load(), which is a data race, which is UB. The fact that the pointer is a shared_ptr doesn't change that. Amends a0303cc7c590ff17fb5b0a5975bff98669e42942. Pick-to: 6.10 6.9 6.8 Change-Id: I8f82e5db240efdd414983f5b1cb0e1c1f1861100 Reviewed-by: Tim Blechmann <[email protected]> Reviewed-by: David Faure <[email protected]>
* QtTest LoggerRegistry: make the stored LoggersContainer constMarc Mutz13 days1-2/+2
| | | | | | | | | | | | | It's immutable, as appends happen on a copy, so let the stored type reflect that. Of course, the initial copy needs to be mutable, so remove the forced cast to SharedLoggersContainer in addLogger(). Amends a0303cc7c590ff17fb5b0a5975bff98669e42942. Pick-to: 6.10 6.9 6.8 Change-Id: I7e3ca8f3779b1e8a653899069d34216f83480d7f Reviewed-by: Tim Blechmann <[email protected]> Reviewed-by: David Faure <[email protected]>
* QtTest WatchDog: fix UB (default-constructed std::atomic)Marc Mutz13 days1-1/+1
| | | | | | | | | | | | | | | | Up to C++17 inclusive, a default-constructed std::atomic object can only be initialized using std::atomic_init(), _not_ by .store(). While it's probably not a problem in practice, it's also not much work to call the std::atomic<T>(T) ctor in the ctor-init-list instead of the implicit default constructor, followed by a store() in the body of the ctor, so do that. Amends a8a38f7caabb90113a229629c6fe463acdecd10f. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I9ba953d1bc34fe09326554a65393b8a2deb35328 Reviewed-by: David Faure <[email protected]>
* QFontDatabase: eradicate goto useMarc Mutz13 days1-28/+15
| | | | | | | | | | | | | | None of these are necessary, so replace them by early returns. Qt does not subscribe to SESE. Mercifully amends the start of the public history. Picking all the way back, because goto's deserve it and this makes the code easier to understand and safer. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I7b38795a2434f09fba7990e1267cb1a9127e37eb Reviewed-by: Volker Hilsheimer <[email protected]>
* tst_selftest: skip benchlibcallgrind for asan buildsMarc Mutz13 days1-1/+8
| | | | | | | | | | | | | | | Valgrind and asan are incompatible. Says Valgrind: ==1602116==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. Fix by excluding the test from asan builds. Amends the addition of -sanitize options; didn't look it up, since it was certainly before Qt 6.0. Pick-to: 6.10 6.9 6.9 6.5 Change-Id: I4c9922323c4e9457a6d721ca594652da6a0a55fb Reviewed-by: Alexey Edelev <[email protected]>
* [docs] QQuaternion: fix links to QVector3D functionsMarc Mutz13 days1-2/+3
| | | | | | | | | | | | | | Without qualification, qdoc links x() to this class' x(). But the documentation means QVector3D::x(), so we need an explicit \l here. Similar to ab1ce95c8ce38683477373cf84ba5686ea00efed for QString/QByteArray. Amends 88142e73d5e062cf26638511a42140b59ef736cc. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I6eb5ca38f328ce36988e10e3221b801e68629938 Reviewed-by: Volker Hilsheimer <[email protected]>
* Doc: silence warning, QMetaType::type() is overloadedVolker Hilsheimer13 days1-1/+1
| | | | | | | | | | Instead of linking from QMetaMethod::typeName() to the deprecated and overloaded static QMetaMethod::type() function, link to QMetaType::name() which is neither, and a more relevant reference. Pick-to: 6.10 6.9 6.8 Change-Id: I2a4451d92d9dd36adf6a55a8069230333358fe63 Reviewed-by: Paul Wicking <[email protected]>
* [docs] QQuaternion: fix grammarMarc Mutz13 days1-1/+1
| | | | | | | | | | "Angles" are plural, so the verb has to be in plural form, too. Amends 88142e73d5e062cf26638511a42140b59ef736cc. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ic19ba9de8b7f33fafb35eff7f256698ebf4b8443 Reviewed-by: Volker Hilsheimer <[email protected]>
* a11y atspi: Don't crash when using DBus Properties GetAllNicolas Fella13 days1-3/+6
| | | | | | | | | | | | | | | | | GetAll only takes one argument, so trying to access the second one will access the arguments list out of bounds. Also, the argument list we get from the AT client might be insufficient compared to what we expect. Take actual argument list size into account when accessing arguments to generate the call. Fixes: QTBUG-137344 Pick-to: 6.10 6.9 Change-Id: Iff602b7036a71505234903893561ab3a87608146 Reviewed-by: MohammadHossein Qanbari <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Michael Weghorn <[email protected]>
* QToolButton a11y: Take menu from default action into accountMichael Weghorn13 days2-7/+22
| | | | | | | | | | | | | | | | | | | | | If a menu is set, QAccessibleToolButton takes it into account for its role, for the QAccessible::State::hasPopup state and for reporting it as an accessible child. So far, this was only working when the menu was directly set using QToolButton::setMenu, but not when the menu came from the default action set via QToolButton::setDefaultAction. From a user perspective, that doesn't make a difference, so also treat these equally on the a11y layer, by taking into account the default action's menu as well. Fixes: QTBUG-138172 Pick-to: 6.10 6.9 Change-Id: Ida6915e983f026db7d9840542e4b5f5c14ae13e1 Reviewed-by: Volker Hilsheimer <[email protected]>
* QToolButton a11y: Use existing method to get QToolButtonMichael Weghorn13 days1-2/+1
| | | | | | | | | Use existing QAccessibleToolButton::toolButton instead of QAccessibleButton::button and casting manually. Pick-to: 6.10 6.9 Change-Id: Ib63553075f5a0a64d436276703e8717a20cc310f Reviewed-by: Volker Hilsheimer <[email protected]>
* QScrollBar: Set parent for context menu to match other widgetsDheerendra Purohit13 days1-1/+1
| | | | | | | | | | | | | | | The QMenu created by QScrollBar::createStandardContextMenu(QPoint) had no parent, unlike similar widgets like QLineEdit or QTextEdit, which set themselves as the parent. This change sets 'this' as the parent of the QMenu to ensure consistent behavior, proper object ownership, and proper transient window handling. Amends: 75ecb176df837331fdac0c386812f5c36e7a6359 Pick-to: 6.10 Fixes: QTBUG-138049 Change-Id: Ie29fe2100ab91f66eec9f02cd5d768005f78afbc Reviewed-by: Volker Hilsheimer <[email protected]>
* QObjectPrivate::ConnectionData: fix UB (default-constructed std::atomic)Marc Mutz13 days1-1/+1
| | | | | | | | | | | | | | | | Up to C++17 inclusive, a default-constructed std::atomic object can only be initialized using std::atomic_init(), _not_ by .store(). While it's probably not a problem in practice, it's also not much work to call the std::atomic<T>(T) ctor instead of the default constructor, so do that. Amends 0cab9b56e99712c6985eee5af72e53e1fb04113d. Pick-to: 6.10 6.9 6.8 Change-Id: Iece5ee724809ce7b5e698871dbc65e14a5d21330 Reviewed-by: Allan Sandfeld Jensen <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* Doc: Fix "see also" linksDavid Boddie13 days2-2/+2
| | | | | | | | | | Some of these links were self-referencing: they referred to the class that contained it. In the future, QDoc will warn about this for "see also" links. Pick-to: 6.5 6.8 6.9 6.10 Change-Id: I95ccc7c8c1dad595f4a9bebcd2d2257b1b316e26 Reviewed-by: Marc Mutz <[email protected]>
* QMainWindowLayout: fix missing std::move() in QDebug stream operatorMarc Mutz13 days1-1/+1
| | | | | | | | | | | | | | | | | | | | Coverity complains about a missing std::move(), because the QDockAreaLayout streaming operator (like all non-QDebug-member ones) takes the QDebug stream by value. Add the missing move(). The const char* stream operator is a QDebug member, so takes the stream by reference, so no std::move() needed. It's a bit sad that it has come to this, but c'est la vie... Amends 1cd7e01c909499b4c4c6d7dd250cc67bbb962141. Coverity-Id: 481489 Pick-to: 6.10 Change-Id: Ifed3a92e3db9eb21edf14bf79ba0c860311f006a Reviewed-by: Axel Spoerl <[email protected]>
* [docs] QQuaternion: fix grammar in toRotationMatrix()Marc Mutz13 days1-2/+2
| | | | | | | | | | Need definite acticles here, not indefinite one. Amends ba640a75a5cc9fec63a5204ccf143dbb7f398842. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I843b9d97276308412d566fbd453c706c9570c876 Reviewed-by: Volker Hilsheimer <[email protected]>
* eglfs/kms: hot-plug and hot-reloadThomas Senyk13 days21-90/+690
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch extends eglfs/kms to react to events during runtime: - screens/displays getting connected ("plug in") as well as disconnected ("unplug") This is only enabled when setting QT_QPA_EGLFS_HOTPLUG_ENABLED - changes to the kms-config-file referenced by QT_QPA_EGLFS_KMS_CONFIG or QT_QPA_KMS_CONFIG eglfs will now reevaluate the connected displays and the referenced kms-config during runtime and react accordingly. Features/functionality of hot-plug: - QKmsDevice::checkConnectedScreens() (new function) will be called by QDeviceDiscovery::deviceChanged (new signal), which is fired by QDeviceDiscoveryUDev::handleUDevNotification when "change"(formerly ignored) is the action driven/created by udev - disconnected screens will be unregistered via QKmsDevice::unregisterScreen (new virtual function, this variant is empty). The code lives in the two implementations of unregisterScreen: QEglFSKmsGbmDevice::unregisterScreen will deal with global-cursor, then call it's parent variant QEglFSKmsDevice::unregisterScreen to call QWindowSystemInterface::handleScreenRemoved, feeding the information about the lost screen into the event loop - each newly connected display will be "configured" via QKmsDevice::createScreenInfoForConnector (refactored function), and then the platform class will be created via QKmsDevice::createScreen Features/functionality of hot-reload: - refactor QKmsDevice::createScreenForConnector to QKmsDevice::createScreenInfoForConnector, as the hot-reload requires to update QPlatformScreens rather then creating new ones right away - QFileSystemWatcher is added to QEglFSKmsGbmIntegration in QEglFSKmsGbmIntegration::createDevice() It will watch the file referenced by QT_QPA_EGLFS_KMS_CONFIG or QT_QPA_KMS_CONFIG When QFileSystemWatcher::fileChanged is fired, two function will be called: - KmsScreenConfig::refreshConfig(), a new function which clears the old config and calls QKmsScreenConfig::loadConfig() - QKmsDevice::updateScreens(), a new function that goes over all plugged-in and enabled screens, recreates their configuration via QKmsDevice::createScreenInfoForConnector, updates them via QKmsDevice/QEglFSKmsDevice::updateScreenOutput (new virtual), and at the end will call QKmsDevice::registerScreens (new function, see "shared changes" for details) Shared changes / necessary refactoring: - QKmsDevice::createScreens was refactored and split, where QKmsDevice::registerScreens contains code regarding screen-cloning, calling QKmsDevice::registerScreen (existing, pure virtual) and calling QKmsDevice::updateScreen (new, virtual function with one "proper" implementation in QEglFSKmsDevice::updateScreen) - Adding code regarding creation and destruction of qt_headless A replacement screen is needed when going to 0 displays, as that is not supported by Qt. This applies to all 3 cases: startup, hotplug and hotreload (while for 'startup' it will only create a headless screen if QT_QPA_EGLFS_HOTPLUG_ENABLED is set) - added "headlessSize" to kms-config to allow the user to configure the specific size of the headless "fake" screen - default value for "headlessSize" is 1024x768 (used to be 0x0) Those two changes are necessary/useful as headless is an implicit feature in this case as the fallback for when the last screen is disconnected. (In contrast to explicit 'headless' option) - a bunch of extra code regarding cloned screens, because they can now be added and removed during runtime (via screen-plug-in/out events as well as config changes) - renaming m_nonThreadedFlipMutex to s_nonThreadedFlipMutex as it's a static member - fix virtualPos to allow for 0,0 to be a valid setting (by having -1,-1 as 'is not set'-value) - QKmsDevice::registerScreens will now check if the cursor is outside the current desktopRegion. If it is, it will be repositioned to be inside (it would vanish otherwise) - adding wait-timout in waitForFlipWithEventReader to account for the fact that cloned screens can be created and added during the runtime. Without a timeout it can happen that the clonee waits forever, as the new clone can be added as a flip-dependency while it isn't scheduled to wake the clonee's wait yet Change-Id: I08421a1be156b6edb9906ef736cba149dab360ff Reviewed-by: Laszlo Agocs <[email protected]>
* QMetaObject::normalizedType: handle nullptrIvan Solovev13 days2-1/+15
| | | | | | | | | | | | | | | | The type normalization code was crashing when passing a nullptr. Fix it by explicitly checking the begin == end case in QTypeNormalizer code. Modify the test code to make the difference between a nullptr and an empty string obvious, and add test-casees to cover these corner cases. Amends 4dbac23e5354638224d8d99ba3342067c015a04b which was added for Qt 6.0, so pick to all active Qt 6 branches. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I0f6855d19146f18170c34061f0631f9192df8bad Reviewed-by: Ahmad Samir <[email protected]>
* QStringAlgorithms: rename replace_detaching() to replace_into_copy()Ahmad Samir14 days1-2/+5
| | | | | | | | | | | | | "detaching" in the old name is confusing. Also add a comment about the rationale of the method, that should be helpful when (re)reading this code in the future. Pointed out in code review. Amends 2075459bcf2c13b94a954fca6fa541de1cb1fcd0. Change-Id: I41dba6d38d93bc595740b97da7b84d6f38d6a222 Reviewed-by: Marc Mutz <[email protected]>
* Windows11Style: draw item text unconditionallyChristian Ehrlicher14 days1-5/+5
| | | | | | | | | | | | | 5d590a38d96206bcf5ad6ffe2b156223dc909fd7 made the drawing of the itemview text dependent whether there is an editor or not. This is in contrast to all other styles and also no longer needed because now the editor properly paints it's background. Pick-to: 6.10 6.9 6.8 Fixes: QTBUG-136217 Task-number: QTBUG-119501 Change-Id: I84f64e71010d1a3d77949dee78426565252bed34 Reviewed-by: Wladimir Leuschner <[email protected]>
* QClipData: fix incorrect realloc() useMarc Mutz14 days1-2/+2
| | | | | | | | | | | | | | | | | | | The realloc() calls unconditionally overwrote m_spans with the result of realloc() before checking whether realloc() succeeded. This way, they leaked memory if realloc() did fail (they lost their handle on the old, still-existing memory block). Fix by piping the realloc() result through q_check_ptr(), which inserts Q_CHECK_PTR(), so we don't need a temporary variable here. As a drive-by, replace C-style cast with static_cast and fix spacing around binary operators. Amends the start of the public history. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ia77a246bf6eec4e29ea6a01f999d3f4a43e0ee1c Reviewed-by: Thiago Macieira <[email protected]>
* QXmlStream: fix incorrect use of realloc()Marc Mutz14 days1-4/+6
| | | | | | | | | | | | | | | | | One must never store the result of realloc() back into the first realloc() argument, because, if relloc() fails, one still has to free() the old pointer, but one has just overwritten its value with nullptr, leaking memory. To fix, first check, and then assign. Found in manual review of realloc() uses. Amends the start of the public history. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Id6d369116d4e01fb9cb1d6db3627b9956d4b6201 Reviewed-by: Thiago Macieira <[email protected]>
* QDataBuffer: fix incorrect use of realloc()Marc Mutz14 days1-4/+6
| | | | | | | | | | | | | | | | | | | One must never overwrite the first argument of realloc() with its result, before checking the result for nullptr, otherwise the old pointer value (which still needs to be free()d when realloc() fails) is lost and therefore memory is leaked. As a drive-by, replace C-style with static_cast. Found by explicit review of realloc() calls (incl. QtPrivate wrappers). Amends the start of the public history. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ifac55291898837a9e063c508e03f1c7da0a0e61f Reviewed-by: Aurélien Brooke <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* QXmlStreamSimpleStack: Q_CHECK_PTR() the correct pointerMarc Mutz14 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | Coverity complains that the QXmlStreamPrivateTagStack default ctor dereferences nullptr. I haven't understood, yet, why it thinks that, but manual inspection revealed a Q_CHECK_PTR() in QXmlStreamSimpleStack::reserve(), called from push(), fingered by Coverity, that comes too late: If Q_CHECK_PTR() is configured to throw std::bad_alloc, then we'd leak the previous buffer if realloc() failed, because we had already overwritten the old value. Fix by moving the Q_CHECK_PTR to after the realloc() and before the assignment of the realloc() result to the data member. Fingers cross that this fixes Coverity's complaint, too. Amends 403343039d07812c0beee9260b291f86e14d8ac4. Coverity-Id: 474174 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ib3564c34626950b927aa54df50abeecc42e8e674 Reviewed-by: Thiago Macieira <[email protected]>
* QProperty: add various missing std::move()sMarc Mutz14 days1-19/+19
| | | | | | | | | | | | | | | | | | Coverity (rightfully) complained that Functor f objects are being passed around by value, but not move()d, but copied. Add the missing std::move()s. This might allow passing move-only function objects now, but I didn't check. This is a de-pessimisation and Coverity complaint fix, as far as I'm concerned. Coverity only shows me two such issues in the file, but I found several others by looking for "Functor f", so fixed those, too. Coverity-Id: 480972 Coverity-Id: 480976 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I3866c94bbbde25d351650838e1e141ecbec38c0d Reviewed-by: Fabian Kosmale <[email protected]>
* QXmlStreamReader: fix a missing std::move()Marc Mutz14 days1-1/+1
| | | | | | | | | | | | | | | | Coverity (rightfully) complains that the assignment uses the copy- and not the move-assignment operator. Fix by adding the missing move(). Amends 927798f5deb0bd95fc8ce5be9fb0cfceef94a46b. Coverity-Id: 481486 Pick-to: 6.10 Change-Id: I9044847abb88adaaa55f49e7578290d11ddb8655 Reviewed-by: Magdalena Stojek <[email protected]> Reviewed-by: Ivan Solovev <[email protected]> Reviewed-by: Giuseppe D'Angelo <[email protected]>
* Exclude one more MSVC version in tst_qcheckedint and tst_qnumericMatthias Rauter14 days0-0/+0
| | | | | | | | | | | | I am using version 1944 and some section in the test that have been marked as not working up until version 1943 are not working with 1944 either. Pumping the version one more time. Amends 4e3a1675793995e44f5c84f28bfdc0fd02aa27cc Pick-to: 6.10 Change-Id: I3e2c803c569a7b9d4ef92202dea6ff5ac3913e8a Reviewed-by: Thiago Macieira <[email protected]>
* QTextCharFormat: improve documentation for font()David Faure2025-07-011-0/+11
| | | | | | | | | | | | | It can be quite confusing to find out that fontItalic() == false but font().italic() == true, or vice-versa. Or worse, the fact that fontPointSize() returns 0 if the size comes from the default font. Fixes: QTBUG-49564 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I05239ed80e82080ea942524f289b953f806c8196 Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* QFileInfoGatherer: Prevent infinite loopTobias Fella2025-07-011-0/+2
| | | | | | | | | | | | | | If the path to be added to the queue already exists at position 0 of the queue, loc is set to 0. This causes the next invocation of lastIndexOf to start at index -1 (the end of the queue). It will then again find the path at index 0. This means that the loop will never terminate, causing the application to freeze here. This patch fixes that by breaking out of the loop if loc is 0. Pick-to: 6.10 6.9 Change-Id: Ib84f0b2766aa39c87f66b94a2e3fbc6ede687521 Reviewed-by: Friedemann Kleint <[email protected]>
* QQuaternion: rename the fromEulerAngles() argumentMarc Mutz2025-07-012-7/+7
| | | | | | | | | | | | The eulerAngles name will clash with a function I intend to add, of the same name, probably triggering -Wshadow. Besides, this fixes long lines and isn't any less readable. Picking all the way since it's 100% risk-free. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Iea552c6cad4ad20164cf0cc462cb1dcb2bc752c0 Reviewed-by: Volker Hilsheimer <[email protected]>
* QQuaternion: fix MingW "redeclared without dllimport attribute" errorMarc Mutz2025-07-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't know why, but after years of no changes to the header, the CI on 6.5 started to throw the dreaded qquaternion.h:138:8: error: 'QQuaternion::QQuaternion()' redeclared without dllimport attribute after being referenced with dll linkage [-Werror] Fix by plastering the class with inline keywords. This just goes to show that separating definition and declaration of inline functions (and exporting non-polymorphic classes wholesale) is usually a bad idea. Remove the inline keywords from the definitions to order to use the linker on all platforms to verify we marked all functions inline that are. Later releases are unaffected, because f9f1272e7c438b79591032877f2b386af8085c3f plastered the class with constexpr, which implies inline. Manual conflict resolution for dev: - there were three inline keywords left outside the class after f9f1272e7c438b79591032877f2b386af8085c3f, this patch removes them, so mark it as a cherry-pick of the 6.5 change, which did the same Pick-to: 6.10 6.9 6.8 Change-Id: I5f044e4aae8e31173c0717d4b70d53fece99b927 Reviewed-by: Volker Hilsheimer <[email protected]> (cherry picked from commit fccb455a4f94e5bc95ba6ad54a46fa71439314bb) Reviewed-by: Daniel Smith <[email protected]>
* QDirEntryInfo: fix GCC optional<> -Wmaybe-uninitializedMarc Mutz2025-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The usual whack-a-mole: libstdc++'s std::optional implementation like to throw a -Wmaybe-uninitalized warning when the default ctor is used. Says GCC 15 (kinda cryptically): In function ‘constexpr void qt_ptr_swap(T*&, T*&) [with T = QFileInfoPrivate]’, inlined from ‘void Qt::qt_ptr_swap(totally_ordered_wrapper<QFileInfoPrivate*>&, totally_ordered_wrapper<QFileInfoPrivate*>&)’ at qcomparehelpers.h:1145:18, inlined from ‘void QSharedDataPointer<T>::swap(QSharedDataPointer<T>&) [with T = QFileInfoPrivate]’ at qshareddata.h:97:18, inlined from ‘void QFileInfo::swap(QFileInfo&)’ at qfileinfo.h:62:17, inlined from ‘QFileInfo& QFileInfo::operator=(QFileInfo&&)’ at qfileinfo.h:59:5, inlined from ‘constexpr void std::_Optional_payload_base<_Tp>::_M_move_assign(std::_Optional_payload_base<_Tp>&&) [with _Tp = QFileInfo]’ at optional:193:19, inlined from ‘constexpr std::_Optional_payload<_Tp, true, false, false>& std::_Optional_payload<_Tp, true, false, false>::operator=(std::_Optional_payload<_Tp, true, false, false>&&) [with _Tp = QFileInfo]’ at optional:442:22, inlined from ‘constexpr std::_Optional_payload<_Tp, false, _Copy, _Move>& std::_Optional_payload<_Tp, false, _Copy, _Move>::operator=(std::_Optional_payload<_Tp, false, _Copy, _Move>&&) [with _Tp = QFileInfo; bool _Copy = false; bool _Move = false]’ at optional:458:26, inlined from ‘constexpr std::_Optional_base<_Tp, <anonymous>, <anonymous> >& std::_Optional_base<_Tp, <anonymous>, <anonymous> >::operator=(std::_Optional_base<_Tp, <anonymous>, <anonymous> >&&) [with _Tp = QFileInfo; bool <anonymous> = false; bool <anonymous> = false]’ at optional:535:23, inlined from ‘constexpr std::optional<QFileInfo>& std::optional<QFileInfo>::operator=(std::optional<QFileInfo>&&)’ at optional:778:11, inlined from ‘QDirEntryInfo& QDirEntryInfo::operator=(QDirEntryInfo&&)’ at qdirentryinfo_p.h:24:7, inlined from ‘void QDirListingPrivate::advance()’ at qdirlisting.cpp:360:30: qswap.h:32:9: warning: ‘*(QFileInfoPrivate**)((char*)&<unnamed> + offsetof(QDirEntryInfo, QDirEntryInfo::fileInfoOpt.std::optional<QFileInfo>::<unnamed>.std::_Optional_base<QFileInfo, false, false>::_M_payload.std::_Optional_payload<QFileInfo, false, false, false>::<unnamed>.std::_Optional_payload<QFileInfo, true, false, false>::<unnamed>.std::_Optional_payload_base<QFileInfo>::_M_payload))’ may be used uninitialized [-Wmaybe-uninitialized] 32 | lhs = rhs; | ~~~~^~~~~ qdirlisting.cpp: In member function ‘void QDirListingPrivate::advance()’: qdirlisting.cpp:360:30: note: ‘<anonymous>’ declared here 360 | entryInfo = {}; | ^ To fix, use the std::nullopt_t ctor instead. Three year old list of upstream bugreports: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635 - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86465 - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100115 - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102801 - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105749 IOW: they (still) don't seem to care much. Amends c39a0d1e8956e042139ce3065681e4c5d07412f3. Pick-to: 6.10 6.9 6.8 Change-Id: I6c724142116f78f0ba8ed311f46b80091e995d74 Reviewed-by: Ahmad Samir <[email protected]>
* QVariant: remove a false statement about C++ unionsGiuseppe D'Angelo2025-07-011-5/+0
| | | | | | | | | Since C++11 unions can store types with non-trivial special member functions. Remove the inaccurate paragraph from the documentation. Pick-to: 6.10 6.9 6.8 Change-Id: I2d2fa7e69da5e30f29e19b39a67a5fc28c250acd Reviewed-by: Thiago Macieira <[email protected]>
* moc: add line numbers to properties, methods, etcSami Shalayel2025-07-014-0/+214
| | | | | | | | | | Those are needed by qmlls to be able to jump to C++ definitions. Task-number: QTBUG-119143 Task-number: QTBUG-128393 Change-Id: I4fb9394b0a22a02501bafdbe95a7cd8998adfe11 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* tst_moc: add missing dependency to mocSami Shalayel2025-07-011-0/+2
| | | | | | | | Add missing dependency to MOC such that the .json files are regenerated automatically when moc was modified. Change-Id: Ie874443b0c11cc7c7feefe1bc1a555c3bd135257 Reviewed-by: Fabian Kosmale <[email protected]>
* Doc: Fix incorrect inheritence statement in QStringList documentationDheerendra Purohit2025-07-011-1/+1
| | | | | | | | | | Updated the documentation to clarify that QStringList is not a separate class. Pick-to: 6.10 6.9 Fixes: QTBUG-102240 Change-Id: Ifdbad8764e9cfaa915cfd7f27872d64b21e14977 Reviewed-by: Thiago Macieira <[email protected]>
* Document the QByteArray(QByteArrayView) constructorMårten Nordheim2025-06-301-0/+9
| | | | | | | | | | | | It was missing from the original commit in 6.8. Amends 21dfb0ebcc6b3a3408a8272ce536a1e4d53910cd Pick-to: 6.10 6.9 6.8 Change-Id: I482a621ecc1a04e3f3ce9ba37c7a1ad22e140ce9 Reviewed-by: Giuseppe D'Angelo <[email protected]> Reviewed-by: Albert Astals Cid <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* Add assertions to qtestlog.cpp where it branches on variant typeEdward Welbourne2025-06-301-0/+8
| | | | | | | | | For ignored messages, only string and regex are possible. For messages to warn about, a null variant is also possible. Pick-to: 6.10 6.9 Change-Id: I3a1b0ebaf541fb8e26794409feb4c5ef9b61d3c3 Reviewed-by: Thiago Macieira <[email protected]>
* Convert qtestlog.cpp to use QVariant::get_if<>(QVariant *)Edward Welbourne2025-06-301-11/+10
| | | | | | Pick-to: 6.10 6.9 Change-Id: I30aefa3dafa0975e53f6a7fb253a37032bb9492a Reviewed-by: Thiago Macieira <[email protected]>
* Clean up some #if-ery in qtestlog.cppEdward Welbourne2025-06-301-10/+8
| | | | | | | | | | Initially motivated by the fact that both branches of a #if closed a parenthesis that was opened only once before it. Found two more instance that could also be tidied up. Pick-to: 6.10 6.9 Change-Id: I268fb8559d0882540746d65ac53d6eee16f1425b Reviewed-by: Thiago Macieira <[email protected]>
* macOS: include QUrl in QAppleFileIconEngineVolker Hilsheimer2025-06-301-0/+1
| | | | | | | | | | | | The type is only forward declared via qmetatype.h so far, and building (presumably) only worked due to pre-compiled headers. Amends f036bd0edadf0f59757f4a8fa695706273eb72d2. Fixes: QTBUG-138100 Task-number: QTBUG-134239 Change-Id: Icc39b23cc08a309cba46c1d9ec598a6a0639754f Reviewed-by: Tor Arne Vestbø <[email protected]>
* QAnyStringView: support single wchar_t arguments also on UnixMarc Mutz2025-06-306-9/+32
| | | | | | | | | | | | | | | | | | | | | | We support char32_t, so there's no reason to not support a 4-byte-wchar_t. This also fixes a nasty asymmery between QString::arg(L'ä') (integral output) and QL1SV::arg(L'ä') or QString::arg(L'ä', L'ä') (characters) [ChangeLog][Important Behavior Changes][QtCore][QString] The unary arg() function now treats wchar_t as a character (string-like; was: integer), so u"%1".arg(L'ø') will now return "ø" and not '248". This makes the function consistent with both QString multi-arg() and QLatin1StringView::arg(). [ChangeLog][QtCore][QAnyStringView] Supports construction from a single wchar_t on all platforms now (was: only on Windows). Fixes: QTBUG-126054 Pick-to: 6.10 Change-Id: I21b7a9782f03d04686207db30d1b1c9d50bc8169 Reviewed-by: Thiago Macieira <[email protected]>
* [docs] QAnyStringView: document single-char ctorMarc Mutz2025-06-301-0/+112
| | | | | | | | Expand the class documentation a bit, too. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I6bab884c7b670671be4d5b3096a120cc9eb5854c Reviewed-by: Thiago Macieira <[email protected]>