aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QQuickLabel: fix background resizingJ-P Nurmi2018-04-101-0/+24
| | | | | | | | | setBackground() must resize the item if component construction is already complete. Change-Id: I76cada5b37257473a9c0146ee1f6de8de6c10218 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 159599e97750ad1a9208a66303552aa8b4f2cdc7)
* TextArea: fix background parentJ-P Nurmi2018-04-051-0/+3
| | | | | | | | | | | | | | | QQuickTextAreaPrivate::attachFlickable() reparents the background from Flickable::contentItem to the Flickable itself. This avoids that the background scrolls together with the content. However, when deferred execution was enabled, attachFlickable() ended up being called before the background had been executed. If the TextArea has already been attached to a Flickable when the background gets exeuted, set the appropriate parent in setBackground(). Task-number: QTBUG-67334 Change-Id: I0847fca5861fdddeac7d47d47316b74bb31500cb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 4a8c2605c26acf575e181682f083e077b815ab4b)
* QQuickControl: respect wheel focus policy for focus scopesJ-P Nurmi2018-02-071-0/+11
| | | | | | | | | [ChangeLog][Controls][Control] Fixed focus scope controls to respect wheel focus policy. Task-number: QTBUG-66133 Change-Id: If963feba4b6e59b87ca54af5f6606805093eb0cc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popup: fix restoring focus for popups that did not request focusJ-P Nurmi2018-02-061-0/+10
| | | | | | | | | | | | When a popup closes, if it has active focus, it should restore focus back to where it was regardless of whether the popup originally requested focus. Even if a popup does not request focus on open, it may gain focus programmatically or when a control with click-focus is clicked, for example. Task-number: QTBUG-66113 Change-Id: I9a7c467abe781bbef390d74898d13b9a30b2695b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickControl: respect click focus policy for focus scopesJ-P Nurmi2018-02-051-0/+72
| | | | | | | | | | | | | | | | | | | | | If a focus scope explicitly requests click focus, make it gain active focus by clearing the sub-focus child. Pane { focusPolicy: Qt.ClickFocus TextField { } } [ChangeLog][Controls][Control] Fixed focus scope controls, such as Frame, GroupBox, Page, and Pane, to respect click focus policy by clearing a potential sub-focus child. This makes it possible to close the virtual keyboard by clicking the background of a Pane that has Qt.ClickFocus set as its focusPolicy, for example. Task-number: QTBUG-66133 Change-Id: I582f3c66aa6f11e229d89c4f610fae3c6259104d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickComboBox: fix popup's deferred executionJ-P Nurmi2018-01-241-0/+14
| | | | | | | | | | | | | | | | | | | | | Unlike other delegates, such as background and contentItem, popup is not unconditionally executed upon component completion. For performance reasons, its execution is delayed until the popup is needed, that is, the popup is accessed or shown. When the popup is accessed, we use the current completion status via isComponentComplete() to determine whether its execution must be completed immediately, or if we can wait until componentComplete(). However, if the popup was accessed while the combobox itself was being completed (used in ComboBox's bindings), the popup was never completed because isComponentComplete() was still returning false even though the popup was actually being indirectly accessed from componentComplete(). A simple execution order change, to complete the combobox itself before the popup, fixes the problem. Task-number: QTBUG-65962 Change-Id: I4764eb7e273e7f6fa1dab1a65a02b87722ee7cba Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Control: fix background size regression caused by deferred executionJ-P Nurmi2018-01-221-0/+8
| | | | | | Task-number: QTBUG-65880 Change-Id: Ic4f9fb087f4a78bd4c6257828011240186b6b22e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make Tumbler compatible with deferred executionMitch Curtis2018-01-174-9/+37
| | | | | | | | | Now that the contentItem is created at a different stage, we have to shuffle some code around and add some null checks. Task-number: QTBUG-50992 Change-Id: I34d3a9ea9cb9ab54008a1015b37b1666538c085e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Tumbler: cleanup internal IDsJ-P Nurmi2018-01-111-6/+0
| | | | | | | | We can already cleanup the internal IDs even if Tumbler doesn't have deferred execution enabled. Change-Id: Ide9a0a6c6d1680c6df6b968b5702a6270fea3326 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_sanity: check for internal IDsJ-P Nurmi2018-01-112-0/+73
| | | | | | Task-number: QTBUG-65341 Change-Id: I51bd3390a18e50e37dfdd880dfa8df262d478b04 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_sanity: unblacklist ComboBoxJ-P Nurmi2018-01-111-4/+0
| | | | | | | ComboBox no longer creates a popup instance at construction time. Change-Id: Ie036d75acbd2a7a391c1ed1af590409f4eddd587 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_sanity: exclude internal helper typesJ-P Nurmi2018-01-112-8/+8
| | | | | | | | Test file names against registered QML types to avoid including any internal helper types like CursorDelegate.qml and RectangularGlow.qml. Change-Id: Ia3079ea215eea59f7e405a50c3170fb4530f4239 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add creation benchmarks for qmlbenchJ-P Nurmi2018-01-0547-0/+784
| | | | | | | | | | | | The qmlbench repo has benchmarks only for a subset of controls. They are part of a larger collection of benchmarks that are run periodically, for which the results are collected to Grafana. We have limited resources there, so we don't want to overload it with benchmarks for every single control type. However, for our own benchmarking purposes it is useful to be able to easily benchmark all of them. Change-Id: I920e4c07bce8356e5d9f41d4c1d6ae43e37bb13e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: cleanup the internal ID from BusyIndicatorJ-P Nurmi2017-12-221-1/+0
| | | | | | | | | | | Same as da27cace for the Default style. An internal ID in the OpacityAnimator element prevented deferred execution for the whole content item. Apply the same visibility trick in C++ to avoid having to use an ID in QML. Change-Id: I4b54bbe3044aff9603b1135ac25d7325e01fdff2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix and test deferred execution for Universal & MaterialJ-P Nurmi2017-12-221-3/+6
| | | | | Change-Id: I8ee27a0c65c9ce8c9cc48c6f59d2b34d02849be8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_customization: comment out Tumbler for nowJ-P Nurmi2017-12-221-9/+2
| | | | | | | | | | Due to unclear auto test failurs, Tumbler does not yet have deferred execution enabled for its content item. Because of this, the test is getting full of skips and expect fail's for Tumbler. Just leave it out for now and restore later when Tumbler is fixed. Change-Id: Iab9465e002572d15e5bda6dbd53b71594f593703 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix tst_customizationJ-P Nurmi2017-12-221-1/+69
| | | | | | | | Fix style selection, and make override() actually fail with internal IDs in the built-in styles. Change-Id: Ied321c46cd74039f84b683fb6df99aef2d488eef Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix deferred executionJ-P Nurmi2017-12-2150-6/+3439
| | | | | | | | | | | | | | | | | | If the QML engine refuses to defer execution of a delegate (it contains an ID), we must make sure to cancel any pending deferred execution for the same delegate. Otherwise, we may end up overriding a custom (non- deferred) delegate with a default (deferred) delegate. This patch adds a new test style "identified" to tst_customization. This style contains delegates with IDs so we can test the behavior with IDs in base styles. Furthermore, overriding delegates is now tested in various ways (with and without IDs in the base and custom styles) in a separate test method. This is done by generating QML code to override delegates with dummy Item instances with appropriate IDs and names. Task-number: QTBUG-65341 Change-Id: Ie6dca287cb74672004d9d8f599760b9d32c3a380 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Default: eliminate internal IDs in DelayButtonJ-P Nurmi2017-12-211-2/+0
| | | | | | | | | | | | | | | | An ID in the internal Text element prevented deferred execution for the whole content item. The ID was used for two reasons. First of all, it was used to propagate implicit size from the Text element to the root of the content item. Secondly, it was used to calculate clip areas to provide the same text in two different colors. This patch provides two internal C++ helpers, ItemGroup and ClippedText, that provide these functionalities without the need of using IDs in QML. At the same time we got rid of two wrapper Items and simplified some QML bindings, which results to a nice boost (18->22) in qmlbench on TX1. Task-number: QTBUG-65341 Change-Id: Icf9c09356cf5c0ed641bde537bee7291bd260057 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Default: cleanup the internal ID from BusyIndicatorJ-P Nurmi2017-12-201-1/+0
| | | | | | | | | | An internal ID in the OpacityAnimator element prevented deferred execution for the whole content item. Apply the same visibility trick in C++ to avoid having to use an ID in QML. Task-number: QTBUG-65341 Change-Id: Icb20e4ecc60d1093e849737799bb269f7f03097a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Default: cleanup and test internal IDsJ-P Nurmi2017-12-201-0/+14
| | | | | | | | | Remove the undesired internal IDs where easily possible, and add expected failures for the harder ones for now. Task-number: QTBUG-65341 Change-Id: I5964b2cb59652661c90141259c68b95c721cf6ca Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make tst_customization easier to maintainJ-P Nurmi2017-12-2016-256/+69
| | | | | | | | | | | | | | | | Maintain the tested controls and delegates in a single array that can be re-used for testing all styles without repetitive and error-prone hand-written data rows. For this to work, the structure of the tested styles must match. The "incomplete" and "override" styles filled in all possible delegates, whereas the "simple" style filled in only the normally used delegates. The test styles have now been synced with the structure of our built- in styles. For example, Dials and Sliders don't normally have a content item, and CheckBoxes and RadioButtons don't normally have a background. Change-Id: I48a26ee170f66882c55b54a282f2e4b3a3875f9a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Attempt to stabilize tst_tumbler::test_itemsCorrectlyPositioned()J-P Nurmi2017-12-201-2/+2
| | | | | | | | | | | | | | | Since 8e4b910, we've been often seeing the following failure in CI: FAIL! : tst_controls::Default::Tumbler::test_itemsCorrectlyPositioned() Compared values are not the same Actual (): 0.00008000000001118224 Expected (): 0 Loc: [/Users/qt/work/qt/qtquickcontrols2/tests/auto/controls/data/tst_tumbler.qml(352)] QQuickPathView uses such tiny 0.00001 offsets internally. => Use fuzzy compare for the expected position. Change-Id: Ie6c1025003aa57335232d23fb8466d1578dc1ab3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* StackView: don't block touchJ-P Nurmi2017-12-201-0/+22
| | | | | | | | | | | Unlike with mouse events there's setAcceptedMouseButtons(), currently there's no way to control whether a control receives touch events or not. As a temporary workaround until QQuickItem::setAcceptTouchEvents() has been added, we'll have to ignore touch events by hand. Task-number: QTBUG-65084 Change-Id: I3d51bdc80981557399f3bdfd181e359679cd1c20 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popups: use deferred executionJ-P Nurmi2017-12-1921-0/+1305
| | | | | | | | | | | QQuickPopup is backed by a QQuickControl subclass aka QQuickPopupItem. However, since the QML engine sees "background" and "contentItem" as properties of QQuickPopup, we must ensure that the deferred properties are executed for the QQuickPopup wrapper object. Task-number: QTBUG-50992 Change-Id: I2ec055b382e41530a6f4a740cb80853c0181c21a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Control: defer the execution of the content itemJ-P Nurmi2017-12-151-14/+0
| | | | | | | | | Tumbler is excluded because test_customContentItemAtConstruction() starts failing if deferred execution is enabled for the content item. Task-number: QTBUG-50992 Change-Id: I11022c3c380311396453cf6229e068e4aae2d82a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Page: use deferred executionJ-P Nurmi2017-12-141-1/+0
| | | | | Change-Id: Icb22f656893c89f61233bb547f03e63240bb8f97 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Extend and improve tst_customizationJ-P Nurmi2017-12-14155-118/+8148
| | | | | | | | | | | | | | | | | | | | Add more test cases, and clarify the roles of the test styles. - empty: no delegates at all - incomplete: has all delegates, but with no bindings that access delegates and therefore trigger creation (tests that delegates must be created regardless) - simple: has all delegates and creates bindings to simulate a full style - override: overrides the simple style and tests that the default instances of overridden delegates are not created There are still several non-popup controls that lack deferred execution. These are marked with QEXPECT_FAIL() to make it easy to track what's missing. This list still excludes all popups. Task-number: QTBUG-50992 Change-Id: I70ce42592e7a320251edebfab3030ccc7c0eb978 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* SpinBox: use deferred executionJ-P Nurmi2017-12-145-0/+275
| | | | | | | | | | tst_controls::SpinBox::test_initialFocus() caught an issue that focus was not transferred as expected when the creation of the content item was deferred. Task-number: QTBUG-50992 Change-Id: I6b9f5684ab7141fa4ebfe4c7fe3e32528553b96d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* GroupBox: use deferred executionJ-P Nurmi2017-12-142-7/+64
| | | | | | Task-number: QTBUG-50992 Change-Id: I3e5c8bf7cc39fae0e882440079bb43292ace1810 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Improve and fix tst_customizationJ-P Nurmi2017-12-142-22/+34
| | | | | | | | | | | | - Don't collect multiple object names for the same object. It was confusing that the "override" tests contained both "label-override" and "label-simple", for instance. - If creation fails, output the error as part of the FAIL message. - Verify that the QML files actually contain correct types. One of the RadioButton tests was accidentally running with a CheckBox. Change-Id: Ide56eed84b5625652321bfe4ef5e32fcf6f45438 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Pane: use deferred executionJ-P Nurmi2017-12-1413-0/+750
| | | | | | Task-number: QTBUG-50992 Change-Id: Ibba0e79f8eaf76336dad3708606484a2846b2912 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ComboBox: use deferred executionJ-P Nurmi2017-12-147-2/+310
| | | | | | | | | | | | As a special case, ComboBox defers the execution of the popup until the popup is either accessed or made visible. This gives a nice boost in creation time benchmarks (20->25, ~25%). The old optimization of setting the delegate model only when the popup is visible is no longer needed. Task-number: QTBUG-50992 Change-Id: Ifeaceb759ab676bb54c6bc09dc97810eade72ca1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ApplicationWindow: use deferred executionJ-P Nurmi2017-12-134-0/+184
| | | | | | Task-number: QTBUG-50992 Change-Id: Ia07055d2fa3d30c91bdf3c526cf7301c7ed1ce2b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* RangeSlider: use deferred executionJ-P Nurmi2017-12-135-0/+271
| | | | | | Task-number: QTBUG-50992 Change-Id: Ibbc946c3402c65f9b100fc74dde04e4d439c8535 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TextArea: use deferred executionJ-P Nurmi2017-12-134-0/+184
| | | | | | Task-number: QTBUG-50992 Change-Id: I6d205f8ea0c90986b18b7e6cedbf347f1ce38eec Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TextField: use deferred executionJ-P Nurmi2017-12-134-0/+184
| | | | | | Task-number: QTBUG-50992 Change-Id: I99a8d97e7f25cfff398fb30e365c7b245b738c37 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Label: use deferred executionJ-P Nurmi2017-12-134-1/+188
| | | | | | Task-number: QTBUG-50992 Change-Id: I8e626d1a0585f93cbd612aca39a1e9050f5e0ed3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Dial: use deferred executionJ-P Nurmi2017-12-135-0/+258
| | | | | | Task-number: QTBUG-50992 Change-Id: I432be00d81344ce129bc8906370555b134fdf423 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Slider: use deferred executionJ-P Nurmi2017-12-135-0/+258
| | | | | | | | | | | Note: It is important to repeat the names of the deferred properties in base classes. The QML engine ask for the class info from the meta- object. A class info declaration in a sub-class overshadows the class info declaration by the same name in the base class. Task-number: QTBUG-50992 Change-Id: Ib674b943db2f0bf196c9386ea22b511715c0a98f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Buttons: defer the execution of the delegatesJ-P Nurmi2017-12-1115-0/+939
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In practice, deferring the execution of the delegates (until accessed) means that the default delegate item does not get created at all, when a custom control replaces it at construction time. Button { background: Rectangle { ... } } Before, such custom Button would never be faster than the original one, because the default delegate was first created and then thrown away at construction time. Originally, this was not considered a huge problem, because the plan was to keep the default delegates so light- weight that it wouldn't matter. However, then came the fancy styles with shadows and effects and thus, heavier default delegates. There's also a growing demand for more features, and the default delegates are slowly getting heavier... Now, after this patch, if you replace a heavy default delegate with a light and simple custom delegate, the result is a much faster control. For example, replacing Material style Button's background, which has a shadow effect, with a plain Rectangle gives a ~10x boost, because the default background with its heavy shadow effect is not executed at all. At the same time, deferring the execution of the default delegates avoids troubles with asynchronous incubation, because we don't need to destroy an object in the middle of the incubation process. Task-number: QTBUG-50992 Change-Id: I2274bff99b9ff126d3748278d58d859222910c98 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix QQuickSlider::valueAt()J-P Nurmi2017-11-071-2/+4
| | | | | | Task-number: QTBUG-64065 Change-Id: Id77a85ce5b88c20795e9f7fe9d2ece974f46a315 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Qt.labs.platform: declare and register enums to the meta systemJ-P Nurmi2017-11-062-0/+74
| | | | | | | | | To make them correctly available in QML so that they also work as signal arguments. Task-number: QTBUG-64259 Change-Id: I5fa00871f96357d924661c4b8af323a0f1748c9d Reviewed-by: Liang Qi <liang.qi@qt.io>
* tst_scrollbar::test_overshoot(): use createTemporaryObject()J-P Nurmi2017-11-031-3/+1
| | | | | Change-Id: Ic98b332c5e30104c4a3c74a873caafa9065d6b5d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Manual tests viewinqwidget: Fix buildFriedemann Kleint2017-11-032-4/+6
| | | | | | | The resource file gallery.qrc was removed, load from path instead. Change-Id: I167c3f967f8a73bf0de9ffe1658c00970b3d8075 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickTextField: retain selection on right mouse button clickJ-P Nurmi2017-11-031-0/+15
| | | | | | | | | | | | | QQuickTextField wants to emit pressed(), released(), and pressAndHold() signals not only on left, but on all mouse button clicks. Therefore it explicitly sets accepted mouse buttons to all. However, the base class, QQuickTextInput, has only been prepared to handle left (selection) and middle (paste) mouse buttons. Don't pass right mouse button -only events to the base class to avoid it clearing selection on right click. Task-number: QTBUG-64048 Change-Id: I015820c78995cc8dd7cbeb16fca0f9b991040bad Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix outdated BSD license headerKai Koehne2017-10-231-2/+12
| | | | | Change-Id: Ibec1396de3e929a229e1550b8045d687aa5a513c Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Speedup tst_pageindicatorJ-P Nurmi2017-10-191-12/+24
| | | | | | | | | | | | test_interactive() was iterating the entire rectangle 2px around each indicator pixel by pixel and sending mouse clicks and touch presses + releases at each coordinate. This resulted to a total of 845 mouse clicks and 845 touch presses and releases. Select a few interesting coordinates to reduce it down to 40 mouse clicks and touch presses and releases. Change-Id: Ie3439aae8481e019956c49d2d82067dac8741b8f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickContainer: fix itemSiblingOrderChanged()J-P Nurmi2017-10-171-3/+27
| | | | | | | | | | | The problem was that QQuickContainer started already moving items while QQmlObjectModel was creating items and QQuickRepeater was initializing the order. Don't reorder items during the creation, but only after component completion. Task-number: QTBUG-61310 Change-Id: I13380c5ab6b3bddaad3fa03ef6fb028622b4cd11 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickToolTip: disable hoverJ-P Nurmi2017-10-121-0/+31
| | | | | | | | | | Tooltips are special popups that should not block hover, because it conflicts with the typical condition for showing tooltips on desktop platforms. Task-number: QTBUG-63644 Change-Id: Ie974aed23a7df8e4b926bec5fe717cb909d15842 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>