summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QtBase: replace windows.h with qt_windows.hYuhang Zhao2021-11-2319-21/+19
| | | | | | | | | | We have some special handling in qt_windows.h, use it instead of the original windows.h Change-Id: I12fa45b09d3f2aad355573dce45861d7d28e1d77 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add support for combining multiple QFuturesSona Kurazyan2021-11-201-0/+514
| | | | | | | | | | | [ChangeLog][QtCore] Added QtFuture::whenAll() and QtFuture::whenAny() functions, returning a QFuture that becomes ready when all or any of the supplied futures complete. Task-number: QTBUG-86714 Change-Id: I2bb7dbb4cdc4f79a7a4fd494142df6a0f93a2b39 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Short live q20::ssize()!Marc Mutz2021-11-201-13/+1
| | | | | | | | | Extract the definition of q20::ssize() from tst_qanystringview.cpp, where it had to be placed for its backport to 6.2. Change-Id: I3f758c98a4b1efd453f4fc044b8d3f1a89de62d1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Skip disabled proxy widgets when (back)tabbingAlexander Volkov2021-11-191-0/+52
| | | | | | | Fixes: QTBUG-98137 Pick-to: 6.2 5.15 Change-Id: If52053dce361b130ef7dcfaf747710d8ceb9bbcd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add more verification when parsing http headers and add testsØystein Heskestad2021-11-191-0/+74
| | | | | | | | Adding tests from QtWebSockets that will reuse QHttpHeaderParser Task-number: QTBUG-80700 Change-Id: I76294a9156173314a3cf09160d0ca4e0d7c6ef3a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Properly fix QFontDatabase test on FreetypeEskil Abrahamsen Blomfeldt2021-11-191-1/+3
| | | | | | | | | | | | Amends 4dd5020fbdfdd34f1e4ec54521217e472942a4b4. I messed up the fix for the XFAIL condition, since the font engine type we get from a normal QFont will be QFontEngine::Multi regardless of whether the actual font engines are Freetype or not. Use NoFontMerging to avoid this. Pick-to: 6.2 Task-number: QTBUG-97995 Change-Id: I2298c997e6826e667dbb8e3d004821f296625ef7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix test when accessing patched plugin too fastPasi Petäjäjärvi2021-11-191-3/+18
| | | | | | | | | At least one OS (QNX) can't dlopen() a library that is still open for writing elsewhere Pick-to: 6.2 Change-Id: I2d4425d8c69162cdfa43c2523c7459def7839eb9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAnyStringView: fix broken implicit conversion from QStringBuilderMarc Mutz2021-11-191-0/+18
| | | | | | | | | | | | | | Need to use QConcatenable<>::ConvertTo for SFINAE, the forwarded type alias in QStringBuilder itself doesn't work. [ChangeLog][QtCore][QAnyStringView/QStringBuilder] Implicit conversion from QStringBuilder to QAnyStringView now works as advertised. Pick-to: 6.2 Fixes: QTBUG-98138 Change-Id: I1c300675cf43b13017bc56398ae5d8c1c51e64fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix assert in QFontComboBox when setting empty fontEskil Abrahamsen Blomfeldt2021-11-181-0/+32
| | | | | | | | | | Don't crash if the font does not have any families set. Pick-to: 6.2 Task-number: QTBUG-97995 Change-Id: I8dc2f2fc00309b6fff6d4a661ec6d659f30808af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix deserializing Qt 5.x fonts through QDataStreamEskil Abrahamsen Blomfeldt2021-11-184-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5, fonts had both singular family and plural families properties, and both were stored separately when streaming through QDataStream. The families list was treated as an extension of family in this case, and the primary font family was always the singular family property. In Qt 6, it has been merged into one and family() is now just a convenience for families().at(0). But when reading files generated with Qt 5, we would ignore the fact that these were previously separated. We would first read the family entry into the families list, and then we would later overwrite this with an empty families list. Instead, we detect streams created with Qt 5.15 or lower and make sure we append the families list instead of overwriting it in this case. In addition, we need to make sure we split up the list again when outputting to Qt 5.x. This adds a file generated with QDataStream in Qt 5.15 to the test to verify. [ChangeLog][Fonts] Fixed a problem deserializing the family of fonts that had been serialized using QDataStream in Qt 5. Pick-to: 6.2 Fixes: QTBUG-97995 Change-Id: Id3c6e13fc2375685643caee5f8e3009c00918ccb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Introduce Q_APPLICATION_STATICMike Achtelik2021-11-183-0/+74
| | | | | | | | | | | | | | QObjects must be deleted if the QCoreApplication is being destroyed. This was previously done by implementing custom code in qtbase and other modules. So unify it and introduce a Q_APPLICATION_STATIC, based on the Q_GLOBAL_STATIC, which centralises the logic. Since we still have a few remaining living QObjects, this comes in handy to fix those as well. Task-number: QTBUG-84234 Change-Id: I3040a2280ff56291f2b1c39948c06a23597865c4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix macOS system locale's formatting of negative yearsEdward Welbourne2021-11-181-3/+0
| | | | | | | It leaves off the minus sign. Change-Id: Iad72349368d8849330524144033453cbd79e9e7c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix formatting of dates before 1601 in MS system localeEdward Welbourne2021-11-181-0/+24
| | | | | | | | | | | | | | | | The relevant MS system calls (say they) don't support date formatting for years < 1601 (but apparently do in fact) and the year field of the data structure is unsigned, so can't support years < 0. As a result, the windows back-end for QSystemLocale failed for negative years. So replace year < 1601 with a place-holder and substitute after formatting. Added new tests (based loosely on one in qtdeclarative that failed) to verify that this actually works. These reveal that macOS also fails to handle negative years; marked as expected failure there pending a fix. Change-Id: I9b63cefd5f0b77a39cf1238549412de3e26ca1bd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add an initial tst_QAnyStringViewMarc Mutz2021-11-184-0/+641
| | | | | | | | | | | It's incomplet, but at least something. Task-number: QTBUG-98138 Pick-to: 6.2 Change-Id: I4630a44b62b190dee8a8cc07822dd6ec67dbdc84 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
* Add baseline test that allows comparing the rendering of widgetsVolker Hilsheimer2021-11-183-0/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide basic boiler plate that sets up the baseline (aka lancelot) framework specifically for comparing the appearance of widgets, and implement test functions for QSlider and QPushButton. Widgets should always look the same if the QPA platform, the OS version, and certain UI-impacting attributes are identical. Ie. on any macOS 10.15 machine that runs in "Light" mode, widgets look the same. On a macOS 11 machine, they might look different. On an OpenSUSE machine using the fusion style things might look different from a Ubuntu machine. The helper function removes DPR differences - images are always scaled to a DPR of 1.0, which allows us to compare the image\ content and not get distracted by them having different dimensions (and the fuzzy comparison of images might make the system tolerate scaling artefacts). Note: For now, this test is meant to be run locally, either when testing changes to style code, or when checking how QWidget based UIs would look on newer version of an operating system. In CI the test is run, but then skipped in CI as the baseline server is not configured. Change-Id: Ie33a9d979d934f0df6883757333ce2c5e2f7ef84 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Do not include qloggingcategory.h in public headersKai Köhne2021-11-162-0/+3
| | | | | | | | | | | | | | | Reduce overhead for including qguiapplication.h by splitting up qnativeinterface.h into a public and a private part. [ChangeLog][Potentially Source-Incompatible Changes] The qguiapplication.h header no longer implicitly includes qloggingcategory.h. If your code depends on the transitive include, explicitly include <QLoggingCategory> where needed. Pick-to: 6.2 Task-number: QTBUG-97601 Change-Id: Ic02327a1c3092e21730160af5c59a9d58dc1239c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_qsctpsocket: fix compilationMarc Mutz2021-11-161-1/+1
| | | | | | | | The header for QTestEventLoop hadn't been included. Pick-to: 6.2 Change-Id: Ife3418d1634c030c421c2aa55469f5a099386d4b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Rename and restructure the baseline (lancelot) testing codeEirik Aavitsland2021-11-16134-1849/+52
| | | | | | | | | | | | | | | | | | | | In preparation for addition of new baseline tests, establish a new test category, "baseline". This is similar to the category "benchmarks" in that it contains tests that use the QTest framework, but conceptually are not unit tests, in contrast to those under auto/. Move the existing QPainter baseline test, tst_lancelot, into this new category, and rename it accordingly. Baseline tests use the QBaselineTest extension to QTest. Move that extension too into the tests/baseline directory, allowing the clean out of the baselineserver directory. Pick-to: 6.2 Change-Id: I1b527f5867c953b1d22be73798fcf7d1494712ea Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFontComboBox don't response qApp fontDatabaseChanged()Zhang Hao2021-11-161-5/+8
| | | | | | | | | | | | | | | If QFontComboBox is instantiated in the form of new and call QFontDatabase::addApplicationFont, QFontComboBoxPrivate::_q_updateModel() will be called when the program exits, at this time qApp will crash. Fix this by when program exiting, QFontComboBoxPrivate don't need call _q_updateModel(). Fixes: QTBUG-98099 Done-With: Konstantin Ritt <ritt.ks@gmail.com> Pick-to: 5.15 6.2 Change-Id: I3df3d19c3d1971288d60f2eef386262befbf396b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* tst_qvariant: fix -Wclass-memaccessMarc Mutz2021-11-161-1/+1
| | | | | | | | The source was already protected, but the destination wasn't. Pick-to: 6.2 Change-Id: I300f19c3e65abd8bc1eef4309aefa11852d1c049 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: check if objectClass() is not null in registerNativeMethods()Assam Boudjelthia2021-11-152-12/+48
| | | | | | | | | | | | In case the class doens't have a default constructor, checking for object.isValid() will give false because the object won't be created, however, the class could still be loaded and we could have a valid jclass. Pick-to: 6.2 Fixes: QTBUG-96069 Change-Id: I8d59e26d9d7c0e8e363ce443937091a374a24473 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Revise (recently-added) yearSharingWeekDays() to take a QDateEdward Welbourne2021-11-152-0/+50
| | | | | | | | | | This lets it avoid a two-digit year that would clash with month or day. That shall make fixing up system locale date formatting run cleaner. Add a test for QGregorianCalendar's two extensions. Change-Id: I77083ff9d5e4035763250904a59fcf416286545b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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>