summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* QBindable: Make ordinary Q_PROPERTYs bindablePatrick Stewart23 hours1-0/+186
| | | | | | | | | | | Implements an adaptor from the notification signal of a Q_PROPERTY to QBindable. The Q_PROPERTY does not need to be BINDABLE, but can still be bound or used in a binding. [ChangeLog][Core][Q_PROPERTY] Q_PROPERTYs without BINDABLE can be wrapped in QBindable to make them usable in bindings Change-Id: Id0ca5444b93a371ba8720a38f3607925d393d98a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Stabilize tst_QComboBox::setPalette() with simple palettesAxel Spoerl23 hours1-11/+18
| | | | | | | | | | | | | | | | | | | The test function tst_QComboBox::setPalette() tests if the QComboBox correctly inherits its palette to its QLineEdit child, by directly comparing both palettes after a palette change on the QComboBox. If the application palette for both widget types contains brushes which are either pixmap based or the resolve mask prevents them from being copied, the direct palette comparison between parent and child fails, despite of a correct propagation. This patch sets a simple gray application palette for QComboBox and QLineEdit at the beginning of the test. The QSKIP for macOS is removed, because using simple palettes solves both issues. Change-Id: I61d509745377306d6f8331dfc1ac189fc58cdedb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Blacklist tst_QWidget::showMinimizedKeepsFocus on macOS 13 in CITor Arne Vestbø27 hours1-0/+1
| | | | | | | | | | | | | It started being recorded as flakey after making macOS 13 a significant config in the CI, but it's unclear why the test was not failing during the nightly testing leading up to that. http://testresults.qt.io/grafana/goto/-AzSwMKVz It has also been blacklisted on macOS many times in the past. Change-Id: I7be5fefb3669e9643a98d2ac82059bf0576c6d5c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Temporarily skip tst_qtcuncurrentrun::pollForIsFinished in emulatorFabian Kosmale27 hours2-0/+6
| | | | | | | | | | | This test causes instability in the CI, but so far nobody could reproduce it outside of that specific CI environment. Skip it for now, and investigate the root cause later. Pick-to: 6.2 6.4 Task-number: QTBUG-106906 Change-Id: Idbbc560236ac475fcb4fdd5980397393f7a95474 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Stabilize tst_QWidgetRepaintManager on XCB platformsAxel Spoerl30 hours1-4/+37
| | | | | | | | | | | | | | | When a widget's palette has different brushes in Active / Inactive color groups, or it is pixmap based, multiple paint events are triggered. This leads to unpredictable, double entries in QWidgetRepaintManager::dirtyWidgetList(). This patch overrides event() of all test widgets and ignores activation / deactivation events in order to make the entries of QWidgetRepaintManager::dirtyWidgetList() predictable. Pick-to: 6.4 Change-Id: I164d7ab4148551590ac3c50fcc3b9f98c5ac0535 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Blacklist tst_QWidgetRepainManager functions flaking on XCBAxel Spoerl30 hours1-0/+11
| | | | | | | | | | | | | | | QXcbBackingStore::toImage() returns a QImage that differs from what is displayed on the screen: After multiple moves of children within their parent widget, the last move is not always properly reflected on openSuSE 15.4. This patch blacklists the test functions fastMove, moveAccross and moveInOutOverlapped on openSuSE Leap. Task-number: QTBUG-109036 Pick-to: 6.4 Change-Id: Ideb505570df090b25d30762492d9c60beb6641ff Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_QByteArrayLarge::initTestCase: Skip tests under ASANFabian Kosmale40 hours1-0/+8
| | | | | Change-Id: I0095346fed64d588940f9eddd7ce370e0fecb940 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_qdecompresshelper: Disable big data tests under ASANFabian Kosmale40 hours1-4/+9
| | | | | | | | They are already slow without ASAN, and risk running into timeouts with ASAN enabled. Change-Id: I427b990066d8ffa838ea90a318176fbcba400852 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make XmlStringRef convertible to QAnyStringView/QStringViewMarc Mutz48 hours4-0/+10
| | | | | | | | | | | | | | | | | Both QStringView and QAnyStringView implicitly convert from any container with a fitting value_type, and working std::data, std::size, std::begin and std::end. Add these missing operations (and complementary ones) to XmlStringRef, so it implicitly converts to QStringView and QAnyStringView, too. Add a check to that effect and remove the now-superfluous operator QStringView(). Task-number: QTBUG-103302 Change-Id: I89d586cf64447a82022e06d546d7ee8339fc6dc7 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove perl related functionality from CMake filesAlexey Edelev2 days2-0/+10
| | | | | | | | | Avoid using perl in CMake scripts. Remove the syncqt.pl specific code. Task-number: QTBUG-87480 Change-Id: I7fcd5cc83d173ec463c275b5b50b84f25044a118 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qfloat16: make it a built-in metatypeThiago Macieira3 days2-0/+15
| | | | | | | | | | | I've reserved the IDs for int128, uint128, bfloat16, and float128, because the mask in qvariant.cpp's qIsNumericType() requires primitives to be less than 64 to operate properly. Added a QMetaType/QDataStream test to confirm it is indeed built-in. Change-Id: I3d74c753055744deb8acfffd17247f7f57bada02 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* qfloat16: add QTextStream & QDebug streaming operatorsThiago Macieira3 days1-0/+22
| | | | | Change-Id: Ieba79baf5ac34264a988fffd172655bdcaf12a59 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* qfloat16: add QDataStream testsThiago Macieira3 days1-0/+25
| | | | | | Change-Id: I3d74c753055744deb8acfffd172494bf935864b8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qfloat16: add support for native _Float16 (C2x extended floating point)Thiago Macieira3 days1-2/+2
| | | | | | | | | | | | | | | | | | | | The C++ equivalent is std::float16_t, defined in P1467[1], and is coming with GCC 13 both in native mode (for x86, using AVX512FP16) and in emulated mode. The C and C++ types will be the same type (<stdfloat> simply typedefs). qfloat16 will need to remain a wrapper with an integer member to keep ABI with previous Qt versions. Because it is a trivially-copyable small type, it gets currently passed in registers; the presence of the integer member means it gets passed in general-purpose registers, while a single _Float16 member would be passed in a floating-point register. See: https://gcc.godbolt.org/z/8fEendjff [1] https://wg21.link/p1467 Change-Id: I8a5b6425b64a4e319b94fffd161be56397cb48e6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_QStringApiSymmetry: add checks for QByteArrayViewMarc Mutz4 days1-5/+100
| | | | | | | | | | | | | | | ... where checks for QByteArray existed before. The checks we can't add are - left/right/mid (legacy APIs not implemented in QBAV) - several relational operators, d/t ambiguities. Created QTBUG-108805 to track these. Task-number: QTBUG-108805 Pick-to: 6.4 6.2 Change-Id: I30cc9b29a228d69d32af51234f2c28221478a75c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* tst_QString: check empty regex can replace in empty/null stringMarc Mutz4 days1-0/+3
| | | | | | | | | It's not intuitive, so check lest people break it. Pick-to: 6.4 6.2 Change-Id: I2435cd69be7b77a6ae59cdc7b5fb99658cfc42fd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce QT_NO_AS_CONST and mark QtBase free of itMarc Mutz4 days1-1/+1
| | | | | Change-Id: I680086e767fe6d5c69eb7103b26150293c69b175 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Set simplePalette on staticWidget in tst_QWidget::optimizedResizeMoveAxel Spoerl4 days1-0/+1
| | | | | | | | | | | It was forgotten to assign a simple palette to this object in 1576f827214cca8a2233f3c81e7d0e3d89eb8007 This patch adds the missing line. Pick-to: 6.4 Change-Id: I0acf765d9646ecc8d49791d96b5ea910e11997fe Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* moc: Output the "cloned" flag for methodsUlf Hermann4 days4-0/+56
| | | | | | | | | We will need it in QML to determine which signal out of a number of "overloads" to generate handlers for. Task-number: QTBUG-108762 Change-Id: Ib73eeb59dbf037bd03faf0d841860d9ebc9e7032 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QGraphicsView: fix jumping graphic items when dragging out of viewTaras Kachmaryk5 days1-0/+108
| | | | | | | | | | | | | | | | | | | | | The algorithms for calculating the scene's position within the view did not compensate for scrollbars showing. The scrollbars should be ignored when positioning hte scene within the view, as alignment only cares about the positioning of the scene when the view is larger than the scene anyway. Add a test case that verifies that items don't jump up or down when dragging horizontally, and not left or right when dragging vertically. Mark variables in the modified function as const where applicable to make it easier to follow the code. Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Fixes: QTBUG-46757 Change-Id: If205637dfe124e0034f68201b23f174d6863084d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add simple palette to tst_QWidgetAxel Spoerl6 days1-0/+47
| | | | | | | | | | | | | | When a widget's palette has different active / inactive colors, multiple paint events can occur. This makes tst_QWidget functions fail when they expect a spcific amount of paint events and the platform theme provides a palette with active / inactive differences. This patch adds a function to populate test widgets with a simple palette, to prevent multiple paint events. Pick-to: 6.4 Change-Id: If9b2faedcc5ca87ba24991cedd5e4ac927b02644 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QPalette: always increase serial number when modifyingVolker Hilsheimer6 days1-0/+8
| | | | | | | | | | | | | | | | | | | After 109e088c7c5d0c9325966e88d55fd9f7a58f67ea, cache keys were unique for palettes with different private or data instances, but the key did not change when a palette without any shared copies was modified, as that does not create new private data structures. To fix this, always increase the counter for the private data structure, also when not detaching from shared copies. Augment test case with scenario that broke. Pick-to: 6.4 Fixes: QTBUG-108709 Change-Id: I606abfb8b1a03e515e46b10dc840a631eb31d496 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* QLocale: Have qstrntod() return end of parsed string also on underflowUlf Hermann6 days1-0/+8
| | | | | | | | | Underflows should be treated the same as overflows. Fixes: QTBUG-108628 Change-Id: I23aa7bbe1d103778cefca08bd3e584e72f306583 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Handle multiple paint events in tst_QWidgetRepaintManagerAxel Spoerl7 days1-2/+22
| | | | | | | | | | | | | | | | | The helper function TestWidget::waitForPainted returned after the test widget had consumed the first paint event. In case of multiple paint events, QRegion paintedRegions did not match the entire region that was supposed to be painted. The test function children() failed/flaked due to that. This patch extends the helper function. After consumption of the first paint event, it processes events until the painted regions no longer change. Pick-to: 6.4 Fixes: QTBUG-108764 Change-Id: I54e14bb07725dd1f602cc93085da13836e3b7494 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Restore end-of-parse reporting to qstrntod()Edward Welbourne7 days1-3/+11
| | | | | | | | | | | | | | | | | | Rework QSimpleParsedNumber to store a qsizetype whose sign serves as ok flag (positive is ok, zero and negative are not) and magnitude is the number of characters used. This replaces an endptr that was set to null to indicate !ok, but that deprived us of end-of-parse information, which is needed for number-parsing. In particular, JS's parsing of numbers accepts overflow (where qstrntod() flags it as invalid) as infinity; so qstrntod() does need to say how long the overflowing (but JS-valid, none the less) number-text was. Modify all callers of functions using this (recently-introduced) type and add tests that fail without this fix. Fixes: QTBUG-108628 Change-Id: I416cd213e1fb8101b1af5a6d43615b970a5db9b4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Blacklist tst_QOpenGLWidget on Ubuntu, RHEL and OpenSuSEAxel Spoerl7 days1-0/+5
| | | | | | | | | | | tst_QOpenGLWidget fails on Linux when other windows on the desktop grab focus. That can happen on CI VMs. This patch blacklists the test on Linux as a temporary solution Task-number: COIN-966 Change-Id: Ibdd7e626f92d2da692bd7c44741e0ca4c9dbd1a8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Blacklist tst_gestures on OpenSuSEAxel Spoerl7 days1-0/+3
| | | | | | | | | | | | | | | tst_gestures flakes in MacOS arm and Linux when delivering a gesture to a screen. The problem cannot be narrowed down to specific test functions. When two test functions with gesture delivery to a screen are called, the second fails. This patch temporarily blacklists OpenSuSE for tst_gestures. Task-number: QTBUG-104496 Task-number: QTBUG-106244 Change-Id: I3bc3c9b82567478784a84006d27f5cbed39d9c9a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QTextLayout: fix maximumWidth() for a text containing line separatorVladimir Belyavsky12 days1-1/+15
| | | | | | | | | | | | | | | | | This is improved version of previous fix 013c346a8dcbd618febb07884c64c740daf9754d that was reverted because it broke some tests for Quick Text. The problem was that it did not work correctly in the case the text was wrapped to a fixed width. To deal with this we'll accumulate current line full width (as if it hadn't been wrapped) in layout data (layoutData->currentMaxWidth). Then when the next line is explicitly wrapped by line or paragraph separator, this accumulated width will be used to adjust layout's maximum width. Change-Id: Iad7119d9808e1db15fe1fbc5db049c3db928529f Fixes: QTBUG-89557 Fixes: QTBUG-104986 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* tst_QMap: remove unused std::as_const cloneMarc Mutz13 days1-6/+0
| | | | | | | | Amends d273076b4474bb473d90e996960c4c773745761a. Pick-to: 6.4 6.2 Change-Id: Icfff438223ed10756f15e25ea52cccdf93dd47a2 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Revert "Add binary compatibility file generated against 6.4.0"Jani Heikkinen2022-11-171-27176/+0
| | | | | | | | | This reverts commit e36abea63bd6732e2d9bacbe155ec547c3367377. Reason for revert: QTBUG-108470 Change-Id: If9aeae8be67594320d00dcdb42c993eda7acaeef Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QString: don't detach in removeStringImpl()Ahmad Samir2022-11-171-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | - If this string is not shared, modify it directly - If this string is shared, instead of detaching copy the characters from this string, except the ones that are going to be removed, to a new string and swap it. This is more efficient than detaching, which would copy the whole string including the characters that are going to be removed. This affects: remove(const QString &str, Qt::CaseSensitivity cs) remove(QLatin1StringView str, Qt::CaseSensitivity cs) Adjust the unittests to test both code paths. [ChangeLog][QtCore][QString] Improved the performance of QString::remove() by avoiding unnecessary data copying. Now, if this string is (implicitly) shared with another, instead of copying everything and then removing what we don't want, the characters from this string are copied to the destination, except the ones that need to be removed. Task-number: QTBUG-106181 Change-Id: Id8eba59a44bab641cc8aa662eb45063faf201183 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString: add unittest to verify erase() returns a QString::iteratorAhmad Samir2022-11-171-0/+10
| | | | | | | Not a const_iterator. Change-Id: I0a9db7cdd956541e0be6e748b084b502fcc1e563 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Reintroduce converter APIs for supporting native clipboard formatsVolker Hilsheimer2022-11-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5, QWin(dows)Mime and QMacMime lived in the respective Extras modules, which were removed and partially folded into the relevant modules in Qt. QWindowsMime and QMacMime continued to provide the abstraction for implementing built-in support for native clipboard formats and UTIs within Qt, but only as private APIs. After the recent clean up of those APIs and respective infrastructure, we can now bring them back as public converter interfaces. Application developers can subclass those and instantiate an instance of their implementation to add support for platform or application specific data formats. These interfaces are not in the QNativeInterface namespace, as applications don't call into Windows or macOS using those interfaces. I.e. there is no class on which an application would call auto *converter= nativeInterface<QWindowsMimeConverter>(); Also, since applications override those converter types, we do want to guarantee binary and source compatibility. [ChangeLog][QtGui][QWindowsMimeConverter] Reintroduced to allow applications to add support for conversion from and to Windows-native clipboard formats to MIME-encoded data. [ChangeLog][QtGui][QUtiMimeConverter] Reintroduced to allow applications to add support for conversion from and to clipboard data on macOS and iOS to MIME-encoded data. Fixes: QTBUG-93632 Change-Id: Iebd909c3970015d203f59d5ab15e306b3d312f6e Reviewed-by: Yuhang Zhao <2546789017@qq.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QString, QByteArray: add removeAt/First/Last() convenience methodsAhmad Samir2022-11-162-0/+32
| | | | | | | | | | | Requested in codereview.qt-project.org/c/qt/qtbase/+/441770 [ChangeLog][QtCore][Text] Add removeAt/First/Last() convenience methods to QString and QByteArray Change-Id: I48a803e456e70cc51d51726a5e3aa7c125aedb1c Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Blacklist tst_Gestures on macOS ARMShawn Rutledge2022-11-161-0/+56
| | | | | | | | | Test causes integrations on macOS to fail. Temporary solution, fixing of auto test required. Task-number: QTBUG-108402 Change-Id: I9ceef8ec425cdd5131bce0cfffcb4daf739e674d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* RHI: Add support for 1D texturesBen Fletcher2022-11-151-0/+510
| | | | | | | Support for 1D textures on Vulkan, OpenGL, Metal, and D3D. Change-Id: Ie74ec103da9cfcbf83fa78588cf8cfc1bd6e104f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* macOS: Add dialog helper for native message boxesTor Arne Vestbø2022-11-151-0/+35
| | | | | | | | | | | | | | | | | The native implementation uses NSAlert, making a best effort to map the QMessageBox properties to the native dialog, falling back to the cross platform non-native dialog if the discrepancy is too big. The initial implementation focuses on the current state of the native dialog helper "protocol", but there's room for improvement here, which would allow even more dialog types and properties to be native. [ChangeLog][macOS] Message boxes such as QMessageBox now follow the platform look and feel by using native dialogs if possible. Change-Id: I4da33f99894194a7b301628cd1fbb44d646ddf18 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-11-151-27/+2
| | | | | | | | | Amends commit 05fc3aef53348fb58be6308076e000825b704e58. Some files were still missing. Task-number: QTBUG-67283 Change-Id: I78b3cbf31138192805b7e186337c6fda4ac844aa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Android: Skip/blacklist remaining tests for emulator bump to API 24Samuel Mira2022-11-152-0/+6
| | | | | | | | | | | | Skip on crashing tst_qvulkan test Blacklisted completer_data on qfiledialog (8d76c5af518599800657ab40d56df4dfbc0a0e85 should have been enough but it is still failing) Task-number: QTBUG-108328 Task-number: QTBUG-108329 Change-Id: Iad5573af60cca16d16ba0462293e276186e25653 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix rhi flush eval perf. and native window problemsLaszlo Agocs2022-11-141-32/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This effectively reverts a4a51f6a641f4bf0a863251d6d3e026d81de6280 while solving the problem that change intended to fix by an alternative approach: Swap the order of checks for rhi-based flushing. Checking the widgets' wishes first was a mistake. We should first check what is forced, e.g. via the env.vars. Then only move on investigating the child widget hierarchy if there was nothing specific requested. This way having a QOpenGLWidget in a window and running with QT_WIDGETS_RHI=1 QT_WIDGETS_RHI_BACKEND=vulkan will prioritize the forced request (Vulkan) and so the QOpenGLWidget will gracefully not render anything while printing the expected warning to tell what's going on. The expensive recursion plaguing the construction of larger widget hierarchies is now avoided, that should no longer take seconds due to walking the entire widget hierarchy of the top-level window every time a new widget is added to it. However, this then uncovered a set of problems concerning native child widgets. The repaint manager seems to have an obvious mistake where the usage of rhi (and so textures and whatnot) is decided based on 'widget' (which is either a top-level or a native child) instead of 'tlw' (which is the top-level with the backingstore). The usesRhiFlush flag only really matters for a real top-level, not for native child widgets. The rhi-based flushing is tied to the backingstore, and the backingstore comes from the top-level widget. Finally, make the qopenglwidget autotest to actually exercise something when it comes to QOpenGLWidgets (or their ancestors) turned native. The original code from a long time ago does not really test native child widgets, because it turns the top-level into native which is quite superfluous since the toplevel is backed by a native window (and a backingstore) anyway. Pick-to: 6.4 Task-number: QTBUG-105017 Fixes: QTBUG-108344 Fixes: QTBUG-108277 Change-Id: I1785b0ca627cf151aad06a5489f63874d787f087 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add comment to tst_QWidget::saveRestoreGeometry() for debuggingAxel Spoerl2022-11-111-0/+7
| | | | | | | | | | | saveRestoreGeometry() somtimes creates a 29px offset when debugged in Qt Creator, which makes the test fail. This patch adds a code comment to make developers aware of this fact. Pick-to: 6.2 6.4 Change-Id: I920bd02eb7543faf8b25a0a242b888f3a3745e2a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Stabilize flakiness in tst_QWidget::multipleToplevelFocusCheck()Axel Spoerl2022-11-111-5/+5
| | | | | | | | | | | | | | | | multipleToplevelFocusCheck() occasionally failed on XCB because QApplication::activeWindow() was nullptr immediately after qWaitForWindowActive() returned true. This patch replaces QCOMPARE on QGuiApplicaiton::activeWindow() with QTRY_COMPARE in order to continue spinning the event loop until the condition has been met. It adds QWidget::activateWindow after show() to ensure focus is acquired also when another window has received focus in the meanwhile. Pick-to: 6.2 6.4 Change-Id: If84eb8b77c5a6b16af271334a1fe5eb92c05644b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Stabilize flakiness in tst_QWidget::raise()Axel Spoerl2022-11-111-2/+5
| | | | | | | | | | | | | | | | | | The test function raise() occasionally failed because of unexpected paint events being counted. This is due to a QTRY_VERIFY returning after consumption of the first paint event. If more than one paint event got posted, it will be delivered and counted when no more paint events are expected. This patch ensures that all paint events are consumed before resetting the count and expecting no more paint events. Fixes: QTBUG-68175 Pick-to: 6.2 6.4 Change-Id: I3e91a34e851da4bd01c7429e824d2b9101077a06 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Remove unused tst_qfontdialog_mac_helpers.mmTor Arne Vestbø2022-11-111-30/+0
| | | | | | | | The uses of the click_cocoa_button() function was removed in 2012, in ba21ca7b5b4b92996c93a0dc4137ea181c4eb79c. Change-Id: If7abfc56bb307cfbf9f6628cec9c7267a8a1f31f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add more tests of QLocale and "single character" data that aren'tEdward Welbourne2022-11-111-7/+41
| | | | | | | | | | | | | | | | This tests that strings using the first Unicode code-point of such a multi-character token don't get recognized as "valid" number strings. This would catch an implementation issue if the parsing code mistakenly matched against only the first code-point of each "single character" token. It also adds tests of integer formatting, with multi-character sign, and reworks some QStringView().toString()s to use u"..."_s. Task-number: QTBUG-107801 Change-Id: I7b868ce2955bb322b3ecfc200438a21437090a0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* emit QWindow::windowStateChanged only when state has changedAxel Spoerl2022-11-112-24/+139
| | | | | | | | | | | | | | | | | Upon programmatic window state changes, windowStateChange was fired once in QWindow::setWindowStates and once when the visual state had been changed by the window interface. This patch adds if guards to ensure that the singal is fired only once. It adds a corresponding autotest to tst_QWindow. tst_QWidget::resizePropagation() is adapted to no longer expect double signal emission. Fixes: QTBUG-102478 Pick-to: 6.4 6.2 Change-Id: If093c0a883d76d8a676e4fab90db6b0676452267 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Windows: Inform accessibility system about the focused child itemVolker Hilsheimer2022-11-111-0/+41
| | | | | | | | | | | | | | | | | | | | | | | When a complex object (i.e. one with children that are themselves not fully exposed objects) gets focus, then we need to inform the accessibility system about which child object actually has focus. This was only done for item views, but not for other complex widgets. An editable QComboBoxes is the focus proxy for its line edit. The line edit never gets focus itself (QComboBox forwards relevant events), and is the accessible child item with index 1. So when an editable combobox gets focus, it needs to raise the automation event for the line edit child. Implement QAccessibleComboBox::focusChild to return the interface to the lineedit for editable comboboxes so that the UI Automation bridge can correctly notify about the focus being moved to an editable text input field. Fixes: QTBUG-107572 Pick-to: 6.4 6.2 Change-Id: Id60e2791ec859365255baa9bfd01547979cd2b44 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* a11y: Add support for Tables in macOS bridgeJan Arve Sæther2022-11-101-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a11y purposes, a table needs to be mapped into a logical accessibility hierarchy. There are several ways of doing this mapping, and unfortunately macOS expects something different than what QAccessibleInterface does. So suppose we have a a 2x2 QTableView with both horizontal and vertical header like this (the names reflect the QAccessible::Role names): +-----------+--------------+--------------+ | | ColumnHeader | ColumnHeader | +-----------+--------------+--------------+ | RowHeader | Cell | Cell | +-----------+--------------+--------------+ | RowHeader | Cell | Cell | +-----------+--------------+--------------+ In order to be presented to the screen reader on a platform, it goes through two rounds of mapping: QAccessibleInterface will have all headers and cells as direct children of the table: - Table +- ColumnHeader +- ColumnHeader +- RowHeader +- Cell +- Cell +- RowHeader +- Cell +- Cell macOS expects a deeper hierarchy: - AXTable [QAccessible::Table] +- AXRow [Qt:no eqiuivalent] +- [QAccessible::Cell] (The content of the cell, e.g. AXButton, AXGroup or whatever) +- [QAccessible::Cell] (The content of the cell, e.g. AXButton, AXGroup or whatever) +- AXRow +- [QAccessible::Cell] (The content of the cell, e.g. AXButton, AXGroup or whatever) +- [QAccessible::Cell] (The content of the cell, e.g. AXButton, AXGroup or whatever) +- AXColumn (this seems to just store the geometry of the column) +- AXColumn (this seems to just store the geometry of the column) +- AXGroup (this represents the column headers) +- AXSortButton (clicking a header cell will trigger sorting) +- AXSortButton (clicking a header cell will trigger sorting) It's unclear to me how RowHeaders are mapped (they are rarer than ColumnHeaders, I expect to find them in e.g. spreadsheet applications). I haven't found any native usage of them. So this patch simply ignores them. Notice that macOS have a three layer deep hierarchy to represent a table (Table->Row->Cell), while QAccessibleInterface has a two-layer deep hierarchy (Table->Row/Cell). In the macOS bridge we therefore need to "inject" the Row/Column element to be "between" the table and the cell. The table will take ownership of all row and column elements that are children of the table. These elements are not inserted into the cache (it would be pointless, since the cache is basically just a mapping between the QAccessibleInterface -> QMacAccessibilityElement, and the row and column elements does not have a corresponding QAccessibleInterface to be mapped from). The rows and columns are therefore also created as soon as the table element is initialized, and they are stored in two NSMutableArray members of QMacAccessibilityElement. A table is constructed like any other accessibility element, with a valid axid and synthesizedRole set to nil. Each child row and column element is constructed with the same axid as the parent table element, and they will have the synthesizedRole set to either NSAccessibilityRow or NSAccessibilityColumn. With the synthesizedRole member we can then identify if we are a row, column or the actual table, and implement their respective behaviors. Notice that the child row/column is created with the parent's table axid in order for them to have a way of finding their parent table element. (there is no 'parent' member variable in QMacAccessibilityElement) This glorious scheme isn't pretty, but seems to work. Fixes: QTBUG-37207 Change-Id: I7c2451e629f5331b9a0ed61dc22c6e74a82cc173 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix type mismatch compiler warning in tst_QGlyphRunAxel Spoerl2022-11-101-33/+33
| | | | | | | | | | | When comparing a glyphIndex with a hard coded number, the number is cast to an int, whereas the glyphIndex is an unsigned int. That causes a compiler warning. This patch forces the numbers to be cast to an unsigned int. Change-Id: I8a31124c6afacfc4ecfb13caf2cb8133dad44a21 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix unused variable compiler warning in tst_qpaletteAxel Spoerl2022-11-101-0/+12
| | | | | | | | | | Debug serials and detatch numbers of deep and shallow detatch in test function cacheKey, if it fails. That implicitly removes a compiler warning about these variables being unused. Change-Id: I481f4b63e3ed0d50fb442dffc658b97d913059bc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>