aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* ScrollView: always clip implicitly created FlickableRichard Moe Gustavsen2020-10-141-2/+0
| | | | | | | | | | | | | | We almost always want to clip the flickable so that flickable contents doesn't show up outside the scrollview. The only time this is not really needed, is when the scrollview covers the whole window and the scrollbars are transient. But for that corner case, if this optimization is needed, the user can simply create his own flickable child inside the scrollview, and control clipping on it explicit. [ChangeLog][ScrollView] ScrollView now clips its contents by default. Change-Id: I44bd7a8c397b90e14d0b9d5db8ec6523da205648 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Be consistent with data tags in tst_styleimportsMitch Curtis2020-10-121-10/+10
| | | | | Change-Id: I3042ad7543eefa3153db0e9eee1ae9186f7011d1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix tst_StyleImports::selectMitch Curtis2020-10-121-9/+9
| | | | | | | | | | | | | 8b534487044dfb3b464431ecb91ef4e0864af4ed made it so that the most appropriate built-in style is chosen by default is no style is specified. This breaks tests that assume the old behavior is still in place. Fix those tests to explicitly set the Basic style. Task-number: QTBUG-86403 Change-Id: I6a51611741e2d0cb9109bb0221c2214a5c5179df Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Native style: ensure ScrollView contents doesn't go under the scrollbarsRichard Moe Gustavsen2020-10-093-5/+3
| | | | | | | | | On macOS the scrollbars are not transient. The contentItem of a ScrollView should therefore be aligned to the side of the scrollbars, rather than to the side of the ScrollView. Change-Id: Ie58753d61c04c979270995deb6e3b2650fa643db Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-0741-108/+108
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I4a690095fcd4b1141550de86b6820ae2dd579429 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Make tests explicitly use Basic where necessaryMitch Curtis2020-10-0718-6/+79
| | | | | | | | | | | | | | | | | | | | | | | | | The previous commit changes the how the default style is set, and since the tests all assumed that Basic was the default, we now need to ensure it is explicitly set. If we want to, we can revert this patch (or file-by-file) later and ensure that these tests work with all styles. For now, just keep things working as they used to. Tests that use QTEST_QUICKCONTROLS_MAIN are not changed, as they already run with all built-in styles. Tests that don't use types that will cause issues, like tst_qquickcolor, do not need to be changed. tst_snippets can be run manually to produce screenshots, so we specify its style in a qtquickcontrols2.conf file to allow it to be overridden by e.g. application arguments (QQuickStyle::setStyle() takes precedence over all other approaches of setting a style). Change-Id: Ifae7e959f89a41a757c170272038fad139bba04f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Default to the most appropriate built-in style if none is specifiedMitch Curtis2020-10-076-3/+15
| | | | | | | | | | | | | [ChangeLog][Styles] An appropriate built-in style is now used as the default style if one is available for the target platform. For example, when running a Qt Quick Controls application on macOS, the macOS style will be used. On Android, the Material style will be used. When running on e.g. an embedded device, where no native style is available, use the Basic (formerly "Default") style. Change-Id: Ie61d1a8a1a83fbeba63387c7ca3671084f47bc04 Fixes: QTBUG-86403 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_designer: fix data tagsMitch Curtis2020-10-071-28/+28
| | | | | | | Use the actual type name instead of "type". Change-Id: I081e226a2a6cda1dd5e5cf976629ceb63a9b8db1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Unblacklist DelayButton::test_mouseMitch Curtis2020-10-075-15/+0
| | | | | | | | This passes for me locally on both macOS and Linux. Task-number: QTBUG-87018 Change-Id: I2d5f27f3f18e8c419485beb1714515b86723bb08 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* nativestyle: SpinBox on WindowsJan Arve Sæther2020-10-061-0/+1
| | | | | Change-Id: I334af68282a59099698e46020b0644318eae5cce Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Unblacklist hover testsMitch Curtis2020-10-025-60/+0
| | | | | | | | | cd669f1f216e54fa59eee77459d608a41f5df290 fixed these tests, but I forgot to unblacklist them in that patch. Task-number: QTBUG-87018 Change-Id: I50b4f571eb9b231449e320ad90da3a9d4ae59a88 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Ensure we pass coordinates to mouseMove()v6.0.0-alpha1Mitch Curtis2020-10-023-3/+3
| | | | | | | | | Unlike the other functions, the x and y parameters do not currently default to the center of the control if unspecified. Change-Id: Ie6c5945c0b43f1ef0d79e76a96da18ea102a50e2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Temporarily blacklist failing touch testsMitch Curtis2020-10-026-0/+179
| | | | | | | | | | So that we can unblock CI. The failures need more time to be looked into. Task-number: QTBUG-87018 Change-Id: I350a4100011127588077edecb73ae11078100940 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* tst_abstrbutton: do press/move/release sequence not press/press/releaseShawn Rutledge2020-09-301-1/+1
| | | | | | | | Amends 6115585477bea66d90acbbd8a25b898d121bd50e Task-number: QTBUG-87018 Change-Id: I3c742bd8fc593f4d3a4f33104e708344fdafe3ec Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* manual style, nativestyle: don't set style from main.cppRichard Moe Gustavsen2020-09-301-14/+0
| | | | | | | | We now select the default style from the QQuickControls plugin, so the removed code snippet is no longer needed. Change-Id: I8117912d424ed7da87f81ce1f90f423a13545e54 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Native style: don't use transient scrollbarsRichard Moe Gustavsen2020-09-302-4/+0
| | | | | | | | We don't want to hide the scrollbars on desktop when it's not moving. Change-Id: I6ce555b06a598560a7253e2b8e6db71405b9322b Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* CMake: Regenerate projects before API changeAlexandru Croitor2020-09-256-48/+87
| | | | | | | Task-number: QTBUG-86815 Change-Id: Ie0688d13b1787da3c1fc241a7d864aa014ca1d70 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Adjust testbench to properly support multiple stylesMitch Curtis2020-09-2414-31/+565
| | | | | | | | | | | | We need to split the uses of the Imagine style API out into file-selected files. We set Imagine.path so that the default assets are used for areas of the UI that are important to the functioning of the example, as using custom assets here could make it impossible to use the API if the assets were not created correctly. Change-Id: I2b6b683ffe65b7d573abf0ae793509a95417aead Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Remove binding to parent in testbenchMitch Curtis2020-09-241-1/+1
| | | | | | Task-number: QTBUG-82989 Change-Id: I5ce70afd395ecf0a0e91a70f19b2f1a04e1c1e6d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Support compile-time style selectionMitch Curtis2020-09-2417-278/+365
| | | | | | | | | | | | | | By allowing importing styles without first importing QtQuick.Controls, which does runtime style selection. [ChangeLog][Styles] It's now possible to select a style at compile-time by importing that style explicitly instead of QtQuick.Controls. This avoids the need to do run-time style selection and hence deploy the QtQuick.Controls plugin with the application. Change-Id: I666d6dc7727fffd2c7b05743855f2086f076465a Fixes: QTBUG-86284 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Rename "Default" style to "Basic"Mitch Curtis2020-09-2439-168/+163
| | | | | | | | | | | | [ChangeLog][Styles] The Default style was renamed to Basic to account for the introduction of the platform styles (macOS, Windows), which will be used by default (where possible) when no style is specified. Fixes: QTBUG-85984 Task-number: QTBUG-68814 Task-number: QTBUG-86403 Change-Id: I22b3199c8662e4ee5d55a1be1a51c9856ac62376 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix fallback styles overwriting themesMitch Curtis2020-09-247-7/+69
| | | | | | | | | | | | | | | | | | | | | In Qt 5, QtQuickControls2Plugin::registerTypes() was responsible for calling initializeTheme() on each style plugin. Now that we delegate more work to the QML engine, each style plugin calls initializeTheme() via registerTypes(). To avoid fallback styles overwriting font and palette data set by the current style, we need to check if the theme has been intialized before calling initializeTheme(). To do this, we add a static "themeInitialized" bool that QQuickStylePlugin sets to true after calling intializeTheme() for the first time. It checks this value and avoids calling intializeTheme() if it's true. We also need to make QQuickStylePlugin ensure that the theme it's initializing belongs to the current style. Fixes: QTBUG-86303 Change-Id: Ie65e646677c78622829f4949c41cb79204cf5786 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix more compiler warnings from deprecated application attributesVolker Hilsheimer2020-09-166-6/+0
| | | | | | | | | Also cleanup documentation, with the exception of the "High-DPI Support in Qt Quick Controls" page, which needs to be either removed or rewritten after some fact checking. Change-Id: I3cdf1f8554f8f26627a9a5f17c2ee0038c933468 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix compile warning from deprecated application attributesVolker Hilsheimer2020-09-151-1/+0
| | | | | | | | | | | AA_DisableHighDpiScaling and AA_UseHighDpiPixmaps have been deprecated. As of 90358f6042d1fe2db849e17e1b0c875fb0560b20 and 2dc46c09026362cc267b1183faf09fb29479ef93 in qtbase, respectively, these settings are deprecated and have no effect. Change-Id: I1eb1f77a64893dd077bd08216d26633d43e1e0e3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Allow the preparation of the exit transition even if it did have focusAndy Shaw2020-09-151-0/+18
| | | | | | | | | | | | | This amends 1a5a0a591c35dcf498a232a802087683f2244ecb so that it only sets the hadActiveFocusBeforeExitTransition variable if it is false, ensuring that it is correctly handled later on if it is true from before. This handles a case of closing, opening and then closing again in one function call. Pick-to: 5.15 Task-number: QTBUG-85884 Change-Id: Ied4ca33045b005f5f666e63d85fb603e9350d982 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Update the text when the inputted value is out of rangeAndy Shaw2020-09-111-0/+25
| | | | | | | | | | | | | | | | | | | When the inputted value is out of range but it would be fixed to the previous value then it would not update the text correctly to show the corrected value. This ensures that it is updated as appropriate. Before it would check if the value had actually changed after it had been fixed to the corrected value. So if it was corrected to the original value then it would not see it as having changed. Additionally the displayText also has the original text before the change, so we have to force through an update to ensure the contentItem's text is updated too. Change-Id: Ic38787d0803ab59cd998f4e2871c613f1642e764 Pick-to: 5.15 Fixes: QTBUG-85719 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix ProgressBar on WindowsJan Arve Sæther2020-09-091-32/+0
| | | | | | | | | | | | | | Also remove the two custom progress bars from the manual test where one has a custom background, and the other has a custom contentItem. If you want to customize a progress bar, you need to provide customizations for both the background and the contentItem. You cannot provide a custom background (or contentItem) alone, since its almost impossible to create a custom background that fits well with the contentItem of all the other possible styles it might be using. Change-Id: I82a87513e73f319bcecbfaed341ac4949f64c3bb Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Native style: call QQuickStylePlugin::registerTypes() from style pluginsMitch Curtis2020-09-073-2/+120
| | | | | | | | This ensures that we received the warning we expect in tst_StyleImports::importStyleWithoutControls when run with native styles. Change-Id: I290f4e72222688e68ae36ace36f1d8be4bedaf31 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickToolTip: don't specify QML import version when creating instanceMitch Curtis2020-09-071-2/+2
| | | | | | | Not all styles will have a specific version, so don't specify it. Change-Id: I92f020314d76934f286ca2946e994e2d1c5d37e5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Native style: set a sensible default width for TextFieldRichard Moe Gustavsen2020-09-071-0/+1
| | | | | | | | | | Set the default width of an empty TextField to 90px (which is a number found by creating an NSTextField in XCode and measuring it with pixeltool). This should also make tst_QQuickPopup::macOS::cursorShape() pass. Change-Id: Ia2a059668c2e1eaea3eef20015a8ea99468dd8ad Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge "Merge remote-tracking branch 'nativestyle' into dev"Mitch Curtis2020-09-0737-1/+3207
|\
| * Merge remote-tracking branch 'nativestyle' into devMitch Curtis2020-09-0437-1/+3207
| |\ | | | | | | | | | Change-Id: I18a4fd46cf13c65fe6f4c3981b7c61ab52109b8d
| | * Native style, manual test: update location to Default styleRichard Moe Gustavsen2020-08-283-5/+5
| | | | | | | | | | | | | | | Change-Id: I3fb788ceba150664ed1c7b4040b73a0b7fdd7337 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Native style: remove versioning from importsRichard Moe Gustavsen2020-08-2828-91/+91
| | | | | | | | | | | | | | | Change-Id: I73319d18ca6540227ce6bf4bdcf217a3c279c64c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Native style: clean-up importsRichard Moe Gustavsen2020-08-283-3/+2
| | | | | | | | | | | | | | | Change-Id: Id05edfccb617c72db902f5a7147ed8433be62e7c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Merge branch 'dev' into nativestyleRichard Moe Gustavsen2020-08-26807-2252/+3072
| | |\ | | | | | | | | | | | | Change-Id: I9999194551f71abec3731355cd746e69e2e0b187
| | * | Native style: move DesktopGallery to manual tests, and rename to nativestyleRichard Moe Gustavsen2020-08-2636-0/+3206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should not be shipped as an example in it's current state. But the app is needed for now as a manual test while we develop the styles. Change-Id: I719ec629789bc4c8b51d14c97afd7b91b822e89b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | Merge branch 'dev' into nativestyleRichard Moe Gustavsen2020-07-1728-211/+520
| | |\ \ | | | | | | | | | | | | | | | Change-Id: I5375ecd1dcbc058806e34fce757df2bf30dac16e
| | * | | Let macOS have TabFocus focus policyJan Arve Sæther2020-06-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is how the macOS platform behaves. This will cause a slight behavior change for all Qt Quick Controls 2 styles on macOS, as reflected by the change in autotests. Change-Id: I9ea744737d0d157ee8c83955f718c1cd889a8c1d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | | | Fix tst_qquickpopup::invisibleToolTipOpen() failing on subsequent runsMitch Curtis2020-09-041-0/+3
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't know why this is necessary, but without it, the mouse area doesn't get any mouse events on subsequent runs (tested with QT_LOGGING_RULES=qt.quick.mouse=true). Change-Id: I69fa13ad282789f522542e52a945973fee66f44d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | | auto tests: remove all versioning from the test dataRichard Moe Gustavsen2020-09-0422-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that QtQuick.Controls.macos is only available with revision 6.0. And when importing e.g QtQuick.Controls 2.15, we try to load a style with the same revision. But it simply doesn't exist. So remove all versioning from the tests to also support testing newer styles. Change-Id: I666a93ab03ec4c5dcf2055a363547f8cdac8d25e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | | tst_qquickmenu: fix flaky testRichard Moe Gustavsen2020-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The included test fails every now and then for Imagine, Fusion and Mac style. By using QTRY_VERIFY to wait a bit before we check if the menu is highlighted, it seems to pass each time. Change-Id: Ib8b207e1b5f81b3086595bb8ad7dc6881272def1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | | tst_qquickmenubar: don't use import versionsRichard Moe Gustavsen2020-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I1cb364046a35eac277ad08268b22851a6147d8c8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | | Dialog: emit accepted()/rejected() before closed()Mitch Curtis2020-09-021-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, the documentation stated the following for e.g. accept(): "Closes the dialog and emits the accepted() signal." In practice, styles that have enter and/or exit transitions for Dialog result in closed() being emitted after accepted() (and rejected()). As there is no way to guarantee this particular order, we should be consistent and swap it around so that accepted()/rejected() are emitted first. [ChangeLog][Important Behavior Changes] Dialog's accepted() and rejected() signals are now emitted before closed() when calling done(), accept() and reject(). Fixes: QTBUG-85748 Change-Id: I706dda8de28c350d65e3188787af8f66a2c5f07d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | | ToolTip: only begin timeout when openedMitch Curtis2020-09-021-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old sequence of events was: 1. setVisible(true) (enter transition begins) 2. startTimeout() 3. opened() (enter transition ends) 4. time out elapses (exit transition begins) 5. closed() (exit transition ends) In most cases, a timeout would be longer than an enter transition, so the only (barely) noticeable issue would be a slightly quicker timeout than what was set. However, if the timeout was shorter than the enter transition, then the sequence would be: 1. setVisible(true) (enter transition begins) 2. startTimeout() 3. time out elapses (exit transition begins) 4. closed() (exit transition ends) This can result in the enter transition being interrupted and the tooltip never being properly visible. Avoid this by only starting the timeout when opened() has been emitted. This also brings the behavior in line with what would be expected when reading the documentation. [ChangeLog][Important Behavior Changes] ToolTip's timeout now begins only after opened() has been emitted. This bug fix results in tooltips with enter transitions being visible for the entire duration of the timeout property. This means that they are visible slightly longer than they were before, so it may be worthwhile to visually check tooltips in your application and adjust timeouts if necessary. Fixes: QTBUG-82257 Change-Id: Iebad64a8cca1f328f9ce85aa78ea0f12918dadf1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | | Menu: Do not unblock parent shortcuts while menu popup is openYuya Nishihara2020-09-022-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise &mnemonic shortcut in the active menu would be stolen by one of the ambiguous items shadowed by the active menu. Fixes: QTBUG-86276 Pick-to: 5.15 Change-Id: I5a1caea60da937fef409720f1ca11b99045ed4b8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | | Menu: Update mnemonic tests to wait until menu is fully closedYuya Nishihara2020-09-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise tst_qquickmenubar of Material style would fail as follows: 1. Type Alt+E to open Edit menu 2. Type Alt+H to switch to Help menu Since the key events of (2) are generated really quick, (2) wouldn't open the Help menu. The Edit menu still exists in the popup stack and blocks the MenuBar shortcuts. I originally thought the closing popup shouldn't block the parent shortcuts. for (QQuickPopup *popup : popups) { if (qobject_cast<QQuickToolTip *>(popup)) continue; // ignore tooltips (QTBUG-60492) + if (!popup->isOpened()) + continue; // closing, or not yet fully open However, the shortcuts in the closing popup are enabled until the popup gets invisible. So changing the resolution of ambiguous shortcuts would introduce another inconsistency. For example, unambiguous shortcut in the closing popup could be triggered, whereas ambiguous one wouldn't win because of the registration order. Task-number: QTBUG-86276 Pick-to: 5.15 Change-Id: I3510cc7a06294e1d1d3512297fc9389bddc4da3b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | | Menu: Close menu by Alt key on platforms supporting mnemonic shortcutsYuya Nishihara2020-09-024-20/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is close to what the widget QMenu (and Windows native menu) do. Before, the active menu was left open and Alt+<key> shortcut would be delivered to one of the matching items, which might be an item shadowed by the active menu popup. With this patch, the active menu is closed on Alt key pressed so the subsequent shortcut event will (likely) be delivered to the matching MenuBar item. Since I'm going to fix the issue of &mnemonic key conflict resolution, I need to first change the way of delivering a shortcut event to the parent MenuBar. The test cases use the undocumented function to simulate low-level behavior of Alt itself and Alt+<key> events. Apparently, there's no public QTest function to send multiple key events without releasing Alt modifier. Task-number: QTBUG-86276 Pick-to: 5.15 Change-Id: I0ed6ea94f0fee7983a5cb6352d388036d3a1f8df Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | | Fix crash when importing a style without first importing ControlsMitch Curtis2020-08-276-0/+322
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following code import QtQuick import QtQuick.Controls.Material ApplicationWindow { width: 200 height: 200 visible: true } produced an error in Qt 5: QQmlApplicationEngine failed to load component qrc:/main.qml:4 ApplicationWindow is not a type In Qt 6, the types are provided by the qmldir, so the import will work, but as QtQuickControls2Plugin has not been loaded, there is no QQuickTheme object yet, and so the style will not work as expected (any colors, fonts, etc. from the theme will not be used by the style). Produce a warning for this scenario, and test each style to make sure that we don't crash. Fixes: QTBUG-86280 Change-Id: I99f940255f56da0522ad192ae5da4c9110ea308e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | | Material: fix binding loops when binding between attached propertiesMitch Curtis2020-08-274-4/+116
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The paletteChanged signal was used as the change signal for a lot of properties. The problem with this was this binding, for example: Material.foreground: Material.toolTextColor results in foreground being set, which emits paletteChanged. toolTextColor has paletteChanged as its change signal, so that is triggered and then the foreground binding is re-evaluated in the middle of already being evaluated. I haven't found a way to fix this for toolTextColor yet, so we temporarily skip emission of toolTextColorChanged when foreground changes. This means that some text will be the wrong color when foreground is changed after startup. For other properties, using more specific change handlers is enough to solve any binding loops. Task-number: QTBUG-85699 Pick-to: 5.15 Change-Id: Ied52d4c38914765ed5c75e234954f4baabaaa9af Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>