summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Make sure we paint overlapped children and siblings when moving farVolker Hilsheimer2021-11-151-1/+118
| | | | | | | | | | | | | | | | | | | | In paintAndFlush, QWidgetRepaintManager subtracts opaque children if the target isn't overlapped and isMoved is set to true. So in moveRect, set isMoved to true after the blitting of movable areas, and reset it to false if we have overlapped sibling or child regions. Otherwise, moving so far that sourceRect is invalid (none of the original pixels are visible after the move) we end up in a code path that sets isMoved to true even with overlapping children or siblings, which then breaks paintAndFlush's assumptions. Reuse the test case written by Sergiy Korobov <tiamatenko@gmail.com> in earlier attempts to fix this bug. Fixes: QTBUG-26269 Pick-to: 6.2 Change-Id: If7443863f5eee79a80220cd587522122f42a21e4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Test result of qobject_cast before dereferencingLi Xi2021-11-151-0/+13
| | | | | | | | | | | | | Since QMainWindow::setMenuWidget accepts a QWidget (allowing users to implement their own menu widget), we need to use qobject_cast on the stored widget to see if it is a QMenuBar before calling QMenuBar APIs. This qobject_cast may return nullptr. Pick-to: 6.2 Fixes: QTBUG-98247 Change-Id: Iff1dbd24fa7ca09098fe49c179770356c966251d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QTabBar: Support scrolling with a kinetic wheelVolker Hilsheimer2021-11-151-16/+179
| | | | | | | | | | | | | | | | | | | | | | | QTabBar implements wheelEvent to move the current index up or down. This is useful for clicky mouse wheels, but a bad user experience when using a kinetic wheel or touch pad, as every pixel movement will change the current index. Instead, scroll the entire tab bar when the wheel event comes from a device that supports scroll phases, without changing the current index. As drive-by's, fix the test introduced in aa09bea00ca88c587cfb1f56 to not leak memory or leave a test-specific style set on the QApplication instance, which can break other tests. Also, make relevant layout code in QTabBar respect the usesScrollButtons property, const'ify local variables, and return an accepted QWheelEvent if the event resulted in a change. [ChangeLog][QtWidgets][QTabBar] Scrolling with a kinetic wheel or touch pad scrolls the entire tab bar, without changing the current index. Change-Id: I990e51466dd25c741877bbf0e197449f897a9efb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QReadWriteLocker: also benchmark recursive modeMarc Mutz2021-11-151-0/+66
| | | | | Change-Id: Ic2e357f4702d05220cf6c96717672dcabacd78d6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* macOS: make the slider knob big enough for BigSur and MontereyVolker Hilsheimer2021-11-151-2/+6
| | | | | | | | | | | The slider is very touch friendly from macOS 11 on, and the knob is quite large. Give it some extra pixels, and adjust the test accordingly. Pick-to: 6.2 Task-number: QTBUG-98093 Change-Id: Iedf6db1081cdd4013ca29ce760aea1e0361b1123 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QFuture: support cancellation of continuation chain through parentSona Kurazyan2021-11-131-0/+126
| | | | | | | | | | | | | | | | | | | This change allows canceling the chain of continuations attached to a future through canceling the future itself at any point of execution of the chain. [ChangeLog][QtCore][Important Behavior Changes] The chain of continuations attached to a future now can be cancelled through cancelling the future itself at any point of the execution of the chain, as it was documented. Previously canceling the future would cancel the chain only if it was done before the chain starts executing, otherwise the cancellation would be ignored. Now the part of the chain that wasn't started at the moment of cancellation will be canceled. Task-number: QTBUG-97582 Change-Id: I4c3b3c68e34d3a044243ac9a7a9ed3c38b7cb02e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Teach QOperatingSystemVersion to handle new OS entries in patch releasesMårten Nordheim2021-11-121-0/+11
| | | | | | | | | | | | | | Adding new entries to QOperatingSystemVersion in patch releases was previously breaking our BC guarantees because the entries are exported, thus users cannot freely switch between different patch-releases without a recompile if they adopted the new entries. Move the data itself to a base class so that the entries can be constructed inline. Task-number: QTBUG-97808 Change-Id: Ic44f07488af8a04a3bedc10bebb740c4d68f43f3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QMultiHash::operator== crashAndreas Buhr2021-11-111-0/+12
| | | | | | | | | | QMultiHash::operator== crashes when comparing two unequal objects. This patch fixes it. Pick-to: 6.2 Fixes: QTBUG-98265 Change-Id: Ibf9fef3372a2b4581843be5f25e65cc9a55ef64d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QDuplicateTracker: add clear()Thiago Macieira2021-11-111-0/+16
| | | | | | | | I'll need it in QFactoryLoader. Pick-to: 6.2 Change-Id: Ice04365c72984d07a64dfffd16b47f68d25252b4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFileDialog: Fix adding default suffix when file path contains dotAlexander Volkov2021-11-121-0/+16
| | | | | | | | | | Check that a file name, not the full path, contains a dot. Fixes: QTBUG-59401 Pick-to: 5.15 6.2 Change-Id: I193b2ae457a3ac6a460524dbf200786eb3461cef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Clean up exports from qlocale_p.hEdward Welbourne2021-11-101-1/+1
| | | | | | | | | | | | Explain why QSystemLocale needs to be an export. Unexport QLocaleId::fromName() now that qttools no longer uses it. QLocalePrivate was only Q_CORE_EXPORT for the sake of one use in tst_QLocale, that can now be replaced by a call to a public QLocale method. Change-Id: I1efe8ee03488acfc6e1c36661f6e956a86e191c3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QPushButton: emit released signal when mouse dragged out of boundsChunLin Wang2021-11-101-0/+31
| | | | | | | | | | | | After special processing for hover, QPushButton::mouseMoveEvent() needs to call the base class function, like every virtual override should, to continue processing other logic. Amends 3310e13a17d2249a86fa533e350744c5593be54f Fixes: QTBUG-97937 Pick-to: 6.0 6.2 Change-Id: Ic2e111d6c38371e0aa04423f5fb26c52717bf5fb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix tst_qfontdatabase on Windows with FreetypeEskil Abrahamsen Blomfeldt2021-11-101-1/+5
| | | | | | | | | | | Since e05e3c776256d35798f451f31cd71e809786ed78, the advance test in tst_QFontDatabase::condensedFontMatching() passes with the bundled freetype engine, so the XFAIL causes a failure when running with this configuration. Pick-to: 6.2 Change-Id: Ie6fbccfa0d9c79654563e9e3f19694f252e32fc6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use a local check-macro to save lots of repetition in time-zone testsEdward Welbourne2021-11-101-90/+53
| | | | | | | | | | Tests of QTimeZone::dispayName() were burying most of what was interesting in the variations among them by repetition of a large amount of boilerplate. Package the repetition in a macro so that the differences between checks are more evident. Change-Id: I23bcafab641b7d3bed50248ba5313250c150d30c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Workaround MSVC 2022 bug about QString::replaceAndreas Buhr2021-11-101-2/+5
| | | | | | | | | | | | MSVC 2022 (17.0.0) complains about "'QString::replace': 12 overloads have no legal conversion for 'this' pointer". This is a compiler bug. It is reported to MS. Still we workaround it here so that qtbase can be built with MSVC 2022. Pick-to: 6.2 Task-number: QTBUG-96975 Change-Id: I0180e2e6760d2809ca61e3cd8f02b04f970172a7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Bump WINVER, _WIN32_WINNT and _WIN32_IE to _WIN32_WINNT_WIN10 (0x0A00)Yuhang Zhao2021-11-102-2/+4
| | | | | | | | | | | And bump NTDDI_VERSION to 0x0A00000B (NTDDI_WIN10_CO) at the same time, to unblock the developers from accessing the latest Windows APIs. Pick-to: 6.2 Change-Id: Ifbc28c8f8b073866871685c020301f5f20dc9591 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: Expose the maximum uniform buffer range limitLaszlo Agocs2021-11-102-0/+4
| | | | | | | | Pick-to: 6.2 Task-number: QTBUG-97715 Change-Id: I7f0a52c410b9b77f735fb3b7fd33141674bb0cda Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add additional grapheme, word, and sentence break class tests from tr29Øystein Heskestad2021-11-104-20/+236
| | | | | | | | | | | Stop turning THAI CHARACTER SARA AM into a grapheme boundary because it breaks a test and chromium does not consider it to be a separate grapheme. Fixes: QTBUG-88545 Change-Id: Ib1aea8dbb66ac42b2129cf9fe04c39f5f76eeb36 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update CLDR-derived data to newly-released v40Ievgenii Meshcheriakov2021-11-101-3/+3
| | | | | | | | | | | | | 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>
* QDomDocument::setContent: Open device if necessaryFabian Kosmale2021-11-091-0/+18
| | | | | | | | | | | | 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>
* Correct and clarify some commentsEdward Welbourne2021-11-081-3/+3
| | | | | Change-Id: I011b04cf0dccea51c00c597c8dff74d574fe36ad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Express 64-bit integral constants consistentlyEdward Welbourne2021-11-081-6/+7
| | | | | | | | Use the Q_INT64_C() macro and qint64()-as-function instead of C-style casts. Change-Id: I9d169715da96a49898e9c9e2a6d3ee5182e1d91c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Give symbolic names to some constants used in time-zone testsEdward Welbourne2021-11-081-12/+15
| | | | | | | | | | Where std::numeric_limits<...>::min() is used used as invalid value for an API return, save it as a named constant so that the comparisons are against an informative name, rather than leaving the reader to guess the significance of the min-value. Change-Id: Ia99c75e21856f65cb4494120d05eed36f5fc2d50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess: Distinguish between null and empty QProcessEnvironmentIevgenii Meshcheriakov2021-11-071-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QPluginLoader: fix indentation and commentsThiago Macieira2021-11-051-1/+1
| | | | | | | | | | | | 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>
* Don't use QCursor::pos in QTabBar and fix hover handlingVolker Hilsheimer2021-11-051-0/+84
| | | | | | | | | | | | | | | | | | | | | | 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>
* QAIV: Reset double-click flag in mousePressEventVolker Hilsheimer2021-11-051-0/+38
| | | | | | | | | | | | | | | 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>
* Include qproperty.h where neededMarc Mutz2021-11-044-0/+4
| | | | | | | Don't rely on transitive include from qobject.h, which will go away. Change-Id: I99dd97ff4fb1d0632d040daab0bffa2d7b85d3ae Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QPluginLoader/ELF: fix Clang ASan buildsThiago Macieira2021-11-041-1/+3
| | | | | | | | | | | | | | | | | | | 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>
* QNI manual test: Remove unnecessary capturing and wrappingMårten Nordheim2021-11-042-4/+4
| | | | | | | | | | | | No need to capture anything by reference, it's a leftover from when the MainWindow was changed from inside the lambda. And no need to wrap the argument to QLatin1String.arg() with QStringView explicitly. This change is made just for brevity and consistency. Change-Id: Ib8c163bcf5932d35a9d43dd8ce124588c539d5a4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QNI: Add API to check if connection is meteredMårten Nordheim2021-11-043-6/+50
| | | | | | | | | | | | | This may be a useful factor in deciding whether or not you should perform communications over the network which are not purely essential. For example, if you have a logging mechanism you can delay uploading them until you are no longer on a metered network. Task-number: QTBUG-91024 Change-Id: I19d32f031a3893512dc440914133678004987fb1 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* wasm: add asyncify manual testMorten Johan Sørvig2021-11-043-0/+85
| | | | | | | | Add simple QtCore-based test case which spins a nested event loop. Change-Id: Ia3a4ef76d561d0554faffcac8d36ae5dda2c6c53 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* QByteArrayList: add join(QByteArrayView)Marc Mutz2021-11-041-0/+28
| | | | | | | | | | | | | | | | | | | Since QByteArray/QByteArrayView don't overload nicely, we need to make the existing QByteArray overload a Q_WEAK_OVERLOAD (= a template) as a tie breaker. This automatically prefers the QByteArrayView version over the QByteArray overload, transparently optimizing existing users passing char string literals to avoid the implicit creation of a QByteArray just for passing the separator. None of our modules exports a subclass of QByteArrayList, so turning join(QByteArray) into a function template should be ok. [ChangeLog][QtCore][QByteArrayList] Added join(QByteArrayView) overload. Change-Id: I090671d9b94c30b63a986f17e966d124c22b5c54 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qlibraryinfo.cpp: use qOffsetStringArray for qtConfEntriesThiago Macieira2021-11-031-5/+5
| | | | | | | | | | Beats a manual array with too wide strings. I thought even to simply replace this with a switch (loc)... it's not like this is performance-critical code, given it uses QString. Change-Id: I2bbf422288924c198645fffd16a977778ff8d52d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Release mouse buttons after double clickVolker Hilsheimer2021-11-031-0/+2
| | | | | | | | | | | Otherwise, the button state maintained by Qt when using the offscreen plugin is not reset, breaking following tests. Pick-to: 6.2 Task-number: QTBUG-97964 Change-Id: Ib37fd038e214863e1e316dc3d41e9d28c157b1f8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io>
* tst_qfile: Remove unused methodsIevgenii Meshcheriakov2021-11-031-2/+0
| | | | | | | | Remove at() and chmod() methods of MyEngine class. Those methods are not used anywhere and look like remainder of old API to me. Change-Id: I754a4281124cb8c9d74e79a9a2b99fb1b1f41e52 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QAbstractFileEngine: Remove useless method overridesIevgenii Meshcheriakov2021-11-032-73/+0
| | | | | | | | | | | | Remove useless overrides of QAbstractFileEngine methods from the derived classes. Also remove "This virtual function must be reimplemented by all subclasses" passages from the QAbstractFileEngine's documentation. There are pure virtual methods for such use cases. QAbstractFileEngine already contains useful defaults for classes not supporting all the functionality. Change-Id: Ia25965854f3809b15d7502da3749cc2f3414bbc3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Rename LinkName to AbsoluteLinkTargetWang Fei2021-11-031-2/+2
| | | | | | | | | | | | | The existing symLinkTarget() always resolves the symlink target to an absolute path; It will be clearer to change LinkName to AbsoluteLinkTarget. It is ready for the commit about add symLinkPath() to read the raw link path. Fixes: QTBUG-96761 Change-Id: I8da7e23b066c9ac1a16abb691aa1c4a5f1ff8361 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Wang Fei <wangfeia@uniontech.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QCollator: add public, static functions to do comparisonsThiago Macieira2021-11-011-0/+15
| | | | | | | | | | | | | | | | | Collation with the default QCollator object (no numeric, punctuation or case sensitivity changes) is a common-place occurrence, so add two functions to do this work. It's also what QString::localeAwareCompare() calls. The test ends up testing that default, static collator updates after the default QLocale changes too. Task-number: QTBUG-95050 Change-Id: I7e0b82c2d2fe464082d8fffd1696ac77f32840b2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Correct qcollator_posix.cpp's check against system localeEdward Welbourne2021-11-011-2/+2
| | | | | | | | | | | | | | The check was made against the default locale but the code calls the system functions (wcscoll, wcsxfrm, wcscmp) for locale-specific collation, so should be comparing to the system locale's collation locale (i.e. LC_COLLATE). Also correct the Android-only check in tst_QCollator::compare() which duplicated the check but neglected the C locale, which is also supported (via QString::compare). Pick-to: 6.2 Change-Id: I48c3237dd6825e2070272ab88d95bdb8cbb9fc37 Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: Add texture array supportLaszlo Agocs2021-10-2911-2/+413
| | | | | | | | | | | | | | Arrays of textures have always been supported, but we will encounter cases when we need to work with texture array objects as well. Note that currently it is not possible to expose only a slice of the array to the shader, because there is no dedicated API in the SRB, and thus the same SRV/UAV (or equivalent) is used always, capturing all elements in the array. Therefore in the shader the last component of P in texture() is in range 0..array_size-1. Change-Id: I5a032ed016aeefbbcd743d5bfb9fbc49ba00a1fa Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix signed/unsigned comparison warnings in tst_QArrayDataEdward Welbourne2021-10-291-6/+6
| | | | | | | | | | QArrayDataPointer<>::size is now a qsizetype, not the uint it used to be. Pick-to: 6.2 Change-Id: I09d7e5a50401b46a12f29f93b2b39d646b771cfc Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QNX: Handle missing elf.h gracefullyJanne Juntunen2021-10-281-5/+11
| | | | | | | | | | | | It seems that after commit id 46fc01d7ca10ab95e53206077c7c710d2032b4f0 the qpluginloder test case cannot find elf.h in QNX test environment. This is just a workaround, fix for missing elf.h (QTBUG-97833) needs to be done later on. Change-Id: I3f6ec36c8ceaed82552fd0e156a56637c056780d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix test to not rely on event processingVolker Hilsheimer2021-10-271-6/+8
| | | | | | | | | | | | | | | | | QTest's simulation of mouse move events currently uses QCursor::setPos and then processes events. This is unreliable across platforms. This test relies on the event processing and either way has inverted logic in the paint event; the painted region needs to at least include the tab's rect, not the other way around. Also, the mouse move wasn't needed here at all, and some styles don't have a different style for pressed tabs anyway. Pick-to: 6.2 Change-Id: Ib8f6f7be017ff87458e96ec419edcd065dd75b15 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Calculate effect bounds when drawing widget graphics effectAntti Määttä2021-10-271-0/+153
| | | | | | | | | | | | | Calculate effect bounds for the updated region when drawing the effect so that the whole affected area gets updated. The effect bounds have already been added to the region so it doesn't need to be handled in the drawing function. Pick-to: 6.2 5.15 Fixes: QTBUG-96240 Change-Id: I0c317311622e6299fb1a3015541408d1d83c93de Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update clipping area when antialiasing changesChen Bin2021-10-271-0/+76
| | | | | | | | | | | | | | | | | | | Antialiasing is disabled when the painter's antialiasing attribute is set behind the clipping function(example `setClipPath` or `setClipRegion`). The cause of this problem is that the antialiasing state of the clipping region is not updated after the antialiasing attribute is set. A variable is required to record the painter's transformation state set before the clipping function, because the transformation will be applied to the clipping region, resulting in the abnormal clipping region. The value of `s->matrix` is not accurate for the clipping fun- ction. Pick-to: 6.2 Fixes: QTBUG-97269 Change-Id: I409a9db32efc3b991ebb97ec9aed19bbddb273d8 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QHash: avoid crashing when reserving on a shared hashMårten Nordheim2021-10-261-0/+17
| | | | | | | | Pick-to: 6.2 Change-Id: I21ad13fa223bd5a2c61112e790965093a2750268 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QHash: double the size of the stored seedThiago Macieira2021-10-261-0/+12
| | | | | | | | | | | | | | | | There's now another half of the seed which will be used by the hashers. This is not stored in QHash, so it is never changed for the lifetime of the application (not even when QHashSeed::setDeterministicGlobalSeed() is called). However, we will not use it when we're in deterministic mode. This commit uses the compiler thread-safe statics to implement the initialization of more than one atomic word, thus freeing us from having to have a reserved value. As a bonus, the QT_HASH_SEED warning will only be printed once. Change-Id: Id2983978ad544ff79911fffd16723f1673f9a5b4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix overflow issue on parsing min-qint64 with its minus sign repeatedEdward Welbourne2021-10-261-0/+1
| | | | | | | | | | | The call to std::from_chars() accepts a sign, but we've already dealt with a sign, so that would be a second sign. Check the first character after any prefix is in fact a digit (for the base in use). This is a follow-up to commit 5644af6f8a800a1516360a42ba4c1a8dc61fc516. Fixes: QTBUG-97521 Change-Id: I65fb144bf6a8430da90ec5f65088ca20e79bf02f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTabBar: re-layout when tab size hint depends on selected stateVolker Hilsheimer2021-10-261-2/+30
| | | | | | | | | | | | | | | | | QTabBar caches the rects for the tabs to avoid costly recalculation of each tab's size hint. That cache is only updated via layoutTabs if the entire tab bar is resized or modified. However, when a style sheet is set that calculates a different size hint for tabs that are selected, then the tab bar also needs to be laid-out when the current tab changes. To minimize the cost, compare the cached size for the new current tab with its new size hint, and re-layout the tabs when they are different. Fixes: QTBUG-6905 Fixes: QTBUG-8209 Pick-to: 6.2 Change-Id: I110444d18938c2b3446ee58e4a8c6c472b5f12c3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>