summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QFactoryLoader: unconditionally provide toJsonFabian Kosmale2021-11-101-2/+0
| | | | | | | | | | | Amends c0a8cfe1677f55daec4bc8626aced41c7ebeb1c4. The StaticPluginLoader needs it, too, and that one is available in non-library configurations. Change-Id: I5d396e78abe7358a5df5ef816cfe92137d3ae4b5 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLocale: Add support for Kaingang and Nheengatu languagesIevgenii Meshcheriakov2021-11-106-8/+77
| | | | | | | | | | Update the locale generation script to support Kaingang and Nheengatu languages. These are new in CLDR v40. Regenerate the locale data. Task-number: QTBUG-94358 Change-Id: I5195d5161d8c4d9f17129bbcfde39dfd3fcf1cd5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Update CLDR-derived data to newly-released v40Ievgenii Meshcheriakov2021-11-106-4805/+4835
| | | | | | | | | | | | | Update tst_qlocale to take into account "narrow" day representation change for Russian locales. This version of CLDR changes narrow forms to one letter. Previously those forms were identical to short forms (two letter). The new representation is consistent with other languages and so does not appear to be a bug. Fixes: QTBUG-94358 Pick-to: 6.2 Change-Id: I9724c281a250685da8232e5c05c9c375a8c79253 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* locale_database: Add entry for 'South Sudan Standard Time'Ievgenii Meshcheriakov2021-11-101-172/+174
| | | | | | | | | | | | This timezone is new in CLDR 40, Olson database calls it Africa/Juba. The offset is UTC+2. Reference: https://techcommunity.microsoft.com/t5/daylight-saving-time-time-zone/2021-time-zone-updates-for-republic-of-south-sudan-now-available/ba-p/2234981 Task-number: QTBUG-94358 Pick-to: 6.2 Change-Id: Ib70dbd9b472eb9cf8cb62a0eb5e241199148c077 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Capture full logcat output in Android unit testsAndreas Buhr2021-11-091-1/+69
| | | | | | | | | | | | | | | Previously, when running unit tests on Android, the log presented to the user was the log as known to the Qt logging system. This does not include log messages generated by Java code using e.g. Log.d("message"). Neither does it include log messages by system libs. This patch changes androidtestrunner to capture the full logcat output for the unit test. This improves the developer experience when working with unit tests. Fixes: QTBUG-93438 Change-Id: I580f728349041eb8a84a32d187754b7b5448f512 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QTestLog: Properly own the loggersUlf Hermann2021-11-093-10/+12
| | | | | | | | | | | | | | | Previously, the loggers would leak if the application failed to call stopLogging(). Now they are owned by the global static which will delete them in that case. Also, since we have to adapt loggerCount() to the fact that std::vector uses size_t, recognize that we only ever want to know whether the number of loggers is 0. Change the method to only provide that information rather than the actual number. Change-Id: Ieb2e185048d573ec7f36373ad49bb2a0ca391ce3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDomDocument::setContent: Open device if necessaryFabian Kosmale2021-11-091-0/+16
| | | | | | | | | | | | This restores the Qt 5 behavior in Qt 6, but prepares for disabling it in Qt 7. We want to deprecate the current behavior, as it makes it unclear who is responsible for calling close. Fixes: QTBUG-97747 Pick-to: 6.2 Change-Id: I2c99eb96667e784576d8850085068ca334d75b16 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add compatible weak pointer move operationsAllan Sandfeld Jensen2021-11-091-1/+18
| | | | | | | We have those on QSharedPointer, so adding them for consistency. Change-Id: Iab5eddc79206605a4bcce46f63e0fb685aed40ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix internal mimetypes db on Windows when compressed by an external toolHannah von Reth2021-11-091-0/+1
| | | | | | | | | Ensure to use binary encoding when handling the output of the compression tool. With out this change \r are dropped and the compressed file is corrupted. Change-Id: Iaf9b1fc015a376682f793aff079f45d03b201aec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid painting outside boundaries when printing QGraphicsProxyWidgetEirik Aavitsland2021-11-091-0/+4
| | | | | | | | | | | Implement clipping to widget geometry when rendering to other paintdevices. Fixes: QTBUG-98026 Pick-to: 6.2 5.15 Change-Id: I5652bdb8cc052ae34f05ea7963943d2b5b28e220 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Don't quit application if we're not in execTor Arne Vestbø2021-11-081-0/+3
| | | | | | | | | | | | | | | | The documentation states that the function will not have any effect before control enters the main event loop. Prior to 0c02f133f3daee1 this was incidentally true due to QCoreApplication::exit just setting quitNow to true and exiting all the event loops (which before exec were none), and exec() setting quitNow to false explicitly. But now that we plumb the quit down to the platform we can't rely on this incidental behavior, and need to check explicitly. Fixes: QTBUG-98088 Pick-to: 6.2 Change-Id: I54cece3630e39e4456abc3b372839c0b5c4c4713 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* qoperatingsystemversion_win: fix thread raceMårten Nordheim2021-11-081-3/+4
| | | | | | | | | | | | If two threads call the function at the same time before the static is initialized one of them may end up with a half-written object. Amends 3fe89eec61e2c819bb54a5d3dfe4bc29dba49ff3 Pick-to: 6.2 Change-Id: Ie08970f9ee283fd75292a8b44a1fca89de4b04eb Reviewed-by: Yuhang Zhao <2546789017@qq.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Draw QTableView grid lines centered between table cellsTor Arne Vestbø2021-11-081-3/+5
| | | | | | | | | | | | | | | | We were reserving space between table cells corresponding to one logical pixel, which on retina screen results in two device pixels. By drawing the grid line with a cosmetic pen, we were only filling one of these pixels, leaving space for leftover pixel dust from earlier blits. By drawing with a non-cosmetic pen of size 1, and ensuring that the grid line is drawn at the center of the grid, we end up filling the entire grid line, without overdrawing the table cells. Pick-to: 6.2 Change-Id: I7f4d2b27380e5a3d221e265a25f7531fdc4a02b3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNI: Windows support for the isMetered APIMårten Nordheim2021-11-083-18/+36
| | | | | | | | | As a drive-by: fix some improper indentation Task-number: QTBUG-91024 Change-Id: I29e04aff3638dfb2aab9d40650c55a48baba7222 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* macOS: Add QCALayerBackingStore::preserveFromFrontBuffer helper functionTor Arne Vestbø2021-11-082-10/+22
| | | | | | Pick-to: 6.2 Change-Id: Iadd4791907564b8b82437643c54696ffa778d882 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Rename QCALayerBackingStore::prepareForFlush()Tor Arne Vestbø2021-11-082-39/+50
| | | | | | | | The need to finalize the back buffer isn't limited to flushing. Pick-to: 6.2 Change-Id: I98b04ab49ec27ea536e99462deab8d48a8e40e82 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Track painted area of backingstore buffer via its dirty regionTor Arne Vestbø2021-11-082-17/+28
| | | | | | | | | When introducing support for scrolling the backingstore it doesn't make sense to track the painted region explicitly. Pick-to: 6.2 Change-Id: I370932f02490ac526fb049908f99af678884e807 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Don't defer back/front-buffer swap in CALayer backingstoreTor Arne Vestbø2021-11-081-25/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | CoreAnimation doesn't immediately mark a surface as in use the moment we assign it to a layer, but defers it until the surface has bee picked up by the window server. In theory this would allow us to defer the swap until the next beginPaint(), which would allow painting to the back buffer again before Core Animation has time to flush the transaction and persist the layer changes to the window server, and would also automatically deal with requests to flush without painting anything. But, since a client may do several rounds of beginPaint/endPaint before flushing, we might end up in a situation where we detect that a surface is in use in the middle of several paint rounds, and end up swapping in a new back buffer without copying over the previously painted content, like we do in prepareForFlush. To be on the safe side we swap the back and front buffer straight away. We also need to mark the surface in use, to prevent the same problem from appearing when the window server doesn't pick up the surface in between two rounds of flushes. Pick-to: 6.2 Change-Id: Ib418852424773c399df710da33a388e8d2c2e92c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Fix some out-of-range issues with time-zone supportEdward Welbourne2021-11-082-12/+24
| | | | | | | | | | | | | | | The MS-Windows back-end neglected to check for overflow when mapping date and time to milliseconds from the epoch. Add the checks for that and take care not to return qint64-min as a transition time - that's the invalidMSecs() value used as a special marker. QTimeZonePrivate::dataForLocalTime() neglected to handle the case of the backend being unable to answer offsetFromUtc() for one of the times requested, which the MS backend might. Change-Id: I6d7ee2cbf9aaf6678abb24a20e18b5cdac7f5a23 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Initialize QStyleOptionProgressBar with QStyle::State_HorizontalZhang Hao2021-11-081-0/+1
| | | | | | | | | | | | | | In Qt 5, QStyleOptionProgressBar::orientation was Qt::Horizontal by default. In Qt 6, we need to init state with QStyle::State_Horizontal so that code setting up a style option doesn't need to do so explicitly. Amends add8262f72befc4c6a25403a21269030111054d1 Pick-to: 6.2 Fixes: QTBUG-93412 Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: Iaa311cf0f4bab72c0bacbd8e698ba24660bca6b8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qC{Debug,Info,Warning,Critical}: Simplify #ifndef QT_NO_xxx_OUTPUTThiago Macieira2021-11-061-24/+32
| | | | | | | | | | | | | Further simplifies the definition of the macros. The class is placed in an unnamed namespace so two translation units can still have different settings. A difference is that the expanded no-output code is now using QDebug, not QNoDebug, but it should get dead-code-eliminated either way. Change-Id: I3eb1bd30e0124f89a052fffd16a7564f4450ec8a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* qC{Debug,Info,Warning,Critical}: centralize common partsThiago Macieira2021-11-061-12/+33
| | | | | | | | | | | Move some content to a helper structure and the rest to a common macro. Immediate advantage is that we avoid calling the category function twice. The Q_UNLIKELY also moves most of the formatting code out of the hot code paths of the functions where it's used. Change-Id: I3eb1bd30e0124f89a052fffd16a754e980c1d971 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QProcess: Distinguish between null and empty QProcessEnvironmentIevgenii Meshcheriakov2021-11-074-63/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for QProcessEnvironment's default constructor says: This constructor creates an empty environment. If set on a QProcess, this will cause the current environment variables to be removed. This is not the case however, because setting such an environment for a process is equivalent to not setting an environment at all and the child process is executed with parent's environment. It is still possible starting from Qt 6.2.0 to create an empty environment by adding a variable to a null environment and removing it, but that's cumbersome, and the comparison operator says that it is equal to the null environment but it is obviously behaving in a different way. This change adds an additional constructor to QProcessEnvironment that can be used to construct a null environment, and changes the default constructor to produce an empty environment. The comparison operator is changed to correctly distinguish between such objects. This is a behavior change, but the current behavior is broken and this is unlikely to affect working code. [ChangeLog][QtCore][QProcessEnvironment] An additional constructor was added to explicitly create an object that when set on QProcess would cause it to inherit the environment from parent (this was formerly the behavior of a default-constructed QProcessEnvironment, which will now (as documented) actually give a process an environment with no variables set). A new method inheritsFromParent() was added to test for such objects. Fixes: QTBUG-58053 Change-Id: I15e20c6a5f01ebe2c736d5578c75dba1ee319320 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wasm: fix size of QDialogsLorn Potter2021-11-061-1/+6
| | | | | | | | | We can simply propagate the minimum window size. Pick-to: 6.2 5.15 Fixes: QTBUG-83503 Change-Id: Ia9f67c92ca37fd0f4e89f08e5153e12c1385f6f8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix network reply status attributeLorn Potter2021-11-061-6/+11
| | | | | | | | | | We were emitting the finished signal before the status code attributes were being set. Fixes: QTBUG-97984 Pick-to: 6.2 5.15 Change-Id: Ib179898dee2b9667d482348ad12180e8bdef74db Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QPluginLoader: fix indentation and commentsThiago Macieira2021-11-051-5/+3
| | | | | | | | | | | | Indetnation was bad in commit 0ab3c5c2505dcfa684fd4a3961f24345de7e1d6f and was missed in code review and one comment wasn't updated when the code was. Take the opportunity to remove an old TODO that has been completed for years. Change-Id: Ice04365c72984d07a64dfffd16b4899604513680 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QCoreApplication: document the app's bindir is in libraryPaths()Thiago Macieira2021-11-051-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The QCoreApplicationPrivate::appendApplicationPathToLibraryPaths() function has been there since at least Qt 4.5.1, so the documentation for appendLibraryPaths() hasn't matched behavior for a minimum of 13 years. The documentation for libraryPaths() has mentioned this fact, though. Searching the application's bin dir is normal on Windows, as many application packages are a flat install with the .exe and all .dlls in one dir. I find it questionable to do so on Unix, though: any and all applications expecting to be installed by a Linux distribution would not install plugins to /usr/bin, whereas on macOS bundles have their own organization anyway. But I'm not prepared to change the behavior without more justification. I can think only of broken configurations (such what is described in QTBUG-97950 where a combination of bad decisions led to scanning all of /usr/bin) and running an executable that is stored in a world-writable directory. Task-number: QTBUG-97950 Pick-to: 6.2 Change-Id: Ice04365c72984d07a64dfffd16b440868373d7a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Revert "QOperatingSystemVersion: Add support for Win10 sub-versions"Thiago Macieira2021-11-062-63/+0
| | | | | | | | | | This reverts commit 9568362bfe9bdbd6a67ab4bbf9fd9504d3868529 because the implementation does not use the agreed-upon solution of static constexpr (thus, inline) variables. This change needs to be re-issued after that suppotr lands. Change-Id: Ib42f3828dcbed66603adc2a699cdac2a8469b263 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QArrayDataOps: fix QList range ctors with mixed value_type in C++20 buildsMarc Mutz2021-11-061-3/+10
| | | | | | | | | | | | | | | | | | The QList<X> range ctor is supposed to accept iterators with value_types convertible to X, e.g. tst_qitemselectionrange passes iterator to a container of QModelIndex to the ctor of a QList<QPersistentModelIndex>. But copyAppend() is not a template, so trying to pass QModelIndex* when QPersistentModelIndex* is expected errors out. Fix by taking the copyAppend() path only if the types match. Amends 507be11303c8dd9709d903f8e5ec197be66209ce. Change-Id: I5e3ff84a80dc05dafde5572463b33df9002c8fe0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Move the ${target}_prepare_apk_dir target descriptionAlexey Edelev2021-11-051-5/+4
| | | | | | | | | Move the description of ${target}_prepare_apk_dir to the right place. The code related to qt_internal_plugins was mistakenly placed between comment and target creation, so move it to avoid confusion. Change-Id: Iaf178811a30ce0f51d6131c8a68f024d3efddfeb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QMacStyle: skip 'custom' rendering of CE_HeaderLabelTimur Pocheptsov2021-11-051-28/+0
| | | | | | | | | | Instead, similar to 'Fusion' style use what common style can do, thus respecting text alignment and not always forcing VCenter alignment. Fixes: QTBUG-97698 Change-Id: I89ad01807afc217c3c33650e1f1d255d0b81ed46 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Remove broken homepage link for Vera fonts attributionLuca Di Sera2021-11-051-1/+0
| | | | | | | | | | | | | | | | The attribution for the Vera Fonts project declares a page on the gnome domain as the homepage of the fonts. The page is not maintained anymore and was removed from the gnome domain. Hence, we remove the "Homepage" key from the Vera Fonts attribution as no homepage seems to exists at the moment. Task-number: QTBUG-96127 Pick-to: 6.2 Change-Id: If4801eb96ce5568c4c18ecea7807ad87e165ca2a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Don't use QCursor::pos in QTabBar and fix hover handlingVolker Hilsheimer2021-11-052-30/+27
| | | | | | | | | | | | | | | | | | | | | | Relying on QCursor::pos makes tests fragile and prevents multi-seat support. Instead, record the mouse position in the already existing event handling, and use that instead. Styles might use either WA_Hover or enable mouse tracking for the widget to enable hover-effects, so we need to support both. Fix the scenario where a newly inserted tab ends up under the mouse, which was previously not handled correctly (only the case of removing a tab was). Clean up the repaint management when the hovered tab changes; just call update on the old rect, and then later update on the new rect; there's no need to make a copy first, updates are posted and compressed. Add a unit test that makes sure that we paint tabs that should be under the mouse in the hovered state. Since not all styles enable hovering and/or mouse tracking in all cases, use a style sheet for those styles that don't. Change-Id: I7cdbb18e9e04b52651e273680fec87b50cb81e05 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* plaintextEdit draw text with clipRect should consider cusorWidthZhang Hao2021-11-051-1/+1
| | | | | | | | | | | If the width of the text to be drawn is equal to the width of clipRect, the cursor will not be displayed. So we need add cursorWidth to the clipRect when draw text. Fixes: QTBUG-94028 Pick-to: 5.15 Change-Id: I8686953f13c04d224327cf0f865ded7241d80ccd Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Move Q_OBJECT_COMPUTED_PROPERTY to QObjectComputedPropertyLuca Di Sera2021-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | `Q_OBJECT_COMPUTED_PROPERTY` is a macro that is used to declare a `QObjectComputedProperty`. The documentation for the macro was related to the `QObjectCompatProperty` documentation, which is internal. A link to `Q_OBJECT_COMPUTED_PROPERTY` appears in `QObjectComputedProperty`'s page, but fails to resolve as the required documentation page is internal. Furthermore, `QObjectCompatProperty` has a macro that is equivalent to `Q_OBJECT_COMPUTED_PROPERTY`, `Q_OBJECT_COMPAT_PROPERTY`, whose documentation is declared related to `QObjectCompatProperty`. It is hence assumed that relating the documentation for `Q_OBJECT_COMPUTED_PROPERTY` to `QObjectCompatProperty` was a typo, such that the documentation for the macro is now moved to be related to `QObjectComputedProperty`, resolving the linking issue in the process. Task-number: QTBUG-96127 Pick-to: 6.2 Change-Id: I2c1bfd6ba64f13e186c65701593047b64bf0c199 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Make sure that all MODULE_LIBRARY targets are built before deploying to AndroidAlexey Edelev2021-11-051-0/+12
| | | | | | | | | | | | | | | Users may add the implicit runtime depedencies to the MODULE_LIBRARY targets, that are created using standard CMake API. When iterating a project tree we collect all module libraries and add them as dependencies to the qt_internal_plugins meta target. All the ${target}_make_apk targets depend on this meta target, so we can be sure that plugins are built and present on the file system before running androiddeployqt. Task-number: QTBUG-94714 Task-number: QTBUG-88841 Change-Id: I4fa7f0772d23897f19db59c6e4ad38646bd3aed6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make sure that all plugin targets are built before deploying to AndroidAlexey Edelev2021-11-052-2/+19
| | | | | | | | | | | | | | | | | | | We need to make sure that all plugin targets are built and present on the file system before running androiddeployqt. This especially important when building executables that depend on qml modules that are built in the project tree. This adds meta target that collects all the plugin targets as dependencies and adds this meta target as the dependency for the custom target that executes androiddeployqt. TODO: We should also take into account MODULE libraries that were added using the CMake add_library call, but since qt6_finalize_project is not a part of 6.2 API, this will be added in follow up commit. Pick-to: 6.2 Task-number: QTBUG-94714 Task-number: QTBUG-88841 Change-Id: I4b4596eb8ed364dbe80e2cfb0ce31cec32e7c03f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix EntryPointMinGW32Target.cmake to be found in top-level buildJoerg Bornemann2021-11-051-1/+3
| | | | | | | | | | | | | | This amends commit 67dadc7e3428169778102a6dfab47e2e48c8d17e. We need to copy EntryPointMinGW32Target.cmake to the build dir. The variable config_install_dir contains path relative to the install prefix, and the copy command needs one relative to the build dir (or an absolute one). Pick-to: 6.2 Fixes: QTBUG-97919 Change-Id: I4e3d735edfb69e27c248191b892422cef572258e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QAIV: Reset double-click flag in mousePressEventVolker Hilsheimer2021-11-051-0/+1
| | | | | | | | | | | | | | | Amends 17c1ebf8bfd254ff75cc55e335d1c1fb01da547f, which introduced logic that recognizes double clicks to avoid duplicate clicked() emits. If a slot connected to doubleClicked opens a dialog, then the release-event will not be seen by the item view, leaving the flag incorrectly set and preventing the next clicked signal. Fixes: QTBUG-97853 Pick-to: 6.2 5.15 Change-Id: Iced83e8c66a763672f522265435dc52a745227e4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Tidy up QPixmapCache to prevent potential segfaultVolker Hilsheimer2021-11-051-23/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following reports of segfaults in long-running programs leading to QPixmapCache corruption, clean up some code smells: * check pointers before dereferencing We did this in some places, and a default constructed or moved-from key could have a nullptr KeyData, so check everywhere. * don't trunctate qsizetype to int Still plenty of int APIs left, but no need for ints in internal code. * don't underflow maxCost to -1 if totalCost was 0 * use ranged-for to iterate over list of keys * guard any public function that might create the cache with the thread- test This avoids that the cache ends up living in the wrong thread. * don't use reinterpret_cast when static_cast is enough (which is always from void*) Since the crash is not reproducible so far, and the reports indicate that it can only be observed when the program has run for a long time, there is no test case included. However, this removes some code smells that might be responsible for data corruption. Pick-to: 6.2 Task-number: QTBUG-97903 Task-number: QTBUG-91445 Task-number: QTCREATORBUG-26473 Change-Id: Ibdd8963d7dd44caab1468ecc6f81ace761719c69 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QByteArrayList: fix narrowing in join() implementations [2/2]Marc Mutz2021-11-053-7/+16
| | | | | | | | | | | | | | | | | | | We forgot to adjust the interface and implementation of join() to the int → qsizetype change in Qt 6. This part of the two-part patch fixes things in a non-forwards-BC way, so it can't be picked into released versions. The forwards-BC part is in the first patch of the series. We can't just replace the int seplen with qsizetype, because qsizetype is an alias to int on 32-bit platforms. So, pass the separator by QByteArrayView. [ChangeLog][QtCore][QByteArrayList] Fixed a bug when calling join() with separators of length > INTMAX. Change-Id: I2ccc61de1c8901ac5504aea1ebd895d12dbcb064 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Include qproperty.h where neededMarc Mutz2021-11-041-0/+1
| | | | | | | Don't rely on transitive include from qobject.h, which will go away. Change-Id: I99dd97ff4fb1d0632d040daab0bffa2d7b85d3ae Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Suppress rc.exe default outputKai Köhne2021-11-041-2/+10
| | | | | | | | | | | | | | Hide output like Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384 Copyright (C) Microsoft Corporation. All rights reserved. when building the auto-generated .rc files. Pick-to: 6.2 Fixes: QTBUG-97729 Change-Id: Id0c32c8015ec2ac0b47b3add52d5c0f8a7a1c203 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QFactoryLoader: remove the porting hack to complete the port to CBORThiago Macieira2021-11-042-20/+5
| | | | | Change-Id: I3eb1bd30e0124f89a052fffd16a6f632c62bcef5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPluginLoader/ELF: fix Clang ASan buildsThiago Macieira2021-11-041-1/+9
| | | | | | | | | | | | | | | | | | | Clang aligns the object at 32-byte boundaries even though we specifically asked for alignof(void*), so tell it not to sanitize the address of the plugin object. Tested with Clang 12 and 13. GCC seems not to be affected, even when ASan is enabled. If this doesn't work, we may need to accept reading a note that is improperly aligned. I don't think the output will be actually a correct note because the intra-note alignment will be wrong (I carefully chose the ELF note name so it would not require alignment, but that's only valid up to 8-byte alignments). Fixes: QTBUG-97941 Change-Id: Ice04365c72984d07a64dfffd16b422fe074d8a70 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Extract Header qbindingstorage.hMarc Mutz2021-11-043-62/+120
| | | | | | | | | | | | | | | QBindingStorage doesn't depend in-size on much else in qproperty.h, but is used in-size in qobject.h, thus requiring qobject.h to include qproperty.h. As a first step, move the class and the bits it actually depends on, to a separate header file, qbindingstorage.h, and, for now, just include that from qproperty.h. The end goal here is to make qobject.h independent of qproperty.h. Pick-to: 6.2 Change-Id: I44245a5e57473067e3106d1fd70bf2d744ce0a5f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QDataStream: remove pointless guard around std::pair operatorsMarc Mutz2021-11-041-2/+0
| | | | | | | | | | | The code is already in 'ifndef QT_NO_DATASTREAM'. Well, the condition is a bit more complicated, which makes this nested guard even more wrong. Amends 55150f0f0bac0a6343da60d8128fc4216b57db2b. Change-Id: I1c8f35ebc0355185244c8bf098d000b7c5c543d5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QByteArrayList: fix narrowing in join() implementations [1/2]Marc Mutz2021-11-042-7/+10
| | | | | | | | | | | | | | | | | We forgot to adjust the interface and implementation of join() to the int → qsizetype change in Qt 6. This part of the two-part patch fixes things in a forwards-BC way, to allow picking into released versions. The forwards-BC break is in the second patch of the series. [ChangeLog][QtCore][QByteArrayList] Fixed a bug when calling join() on lists with more than INTMAX elements. Pick-to: 6.2 Change-Id: I26976864e77169ff0db7c672d1d42d88dbfcc437 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNI NetworkManager: Extract Method primaryConnectionDevicePath()Marc Mutz2021-11-042-5/+15
| | | | | | | Avoids duplication of complex code (RB tree lookup). Change-Id: I70ac7095b05ee56cdf7c86dd1d1a7c9c3232c9d4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNI NetworkManager: Small refactorings and correctness fixMårten Nordheim2021-11-043-25/+20
| | | | | | | | | | Extract and reuse a lambda for initialization and slot object. Pass a QDBusObjectPath parameter by const-ref. Avoid implicit ascii-to-utf16 string conversion. Change-Id: I591ae6e58e010ccabcf9012db866949492e0191d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>