aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QQuickLabel: fix background resizingJ-P Nurmi2018-04-102-11/+21
| | | | | | | | | 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-1/+4
| | | | | | | | | | | | | | | 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)
* Doc: mention QT_QUICK_CONTROLS_CONF in conf docsMitch Curtis2018-02-121-0/+4
| | | | | Change-Id: I7f6d156d54a4c407853af5baa5bf59125ab35bde Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickControl: respect wheel focus policy for focus scopesJ-P Nurmi2018-02-071-1/+1
| | | | | | | | | [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-5/+4
| | | | | | | | | | | | 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-2/+10
| | | | | | | | | | | | | | | | | | | | | 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>
* QQuickPlatformMenu::open(): Scale target rectangleFriedemann Kleint2018-02-011-2/+4
| | | | | | | | The QPlatform* classes operate in native pixels. Task-number: QTBUG-55251 Change-Id: Ic9715bc062f7459054ed9735d133b1a5d05b60a2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QQuickComboBox: fix popup's deferred executionJ-P Nurmi2018-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | 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/+1
| | | | | | Task-number: QTBUG-65880 Change-Id: Ic4f9fb087f4a78bd4c6257828011240186b6b22e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Explain the benefits of customizing a control vs creating a styleMitch Curtis2018-01-191-1/+11
| | | | | | | | | | | Mention that customizing a control is nice because you don't need to start from scratch with a template. Add a third requirement for "Definition of a Style" that mentions that the top level item must be a template, and why. Change-Id: I4db4ec8311baed46fb45271d107204808ba42592 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Link to Customizing doc from Styling docMitch Curtis2018-01-191-0/+1
| | | | | | | These two things are closely related. Change-Id: I1b4586f7835af6bd9f82aaa6eeb75fe1ef6ba65d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Tumbler: reduce amount of signal-slot connections and change listenersMitch Curtis2018-01-173-85/+28
| | | | | | | | | Instead of adding change listeners and signal-slot connections for each attached object, add them once in QQuickTumbler and then notify each attached object all in one go. Change-Id: I6c5e76182c026b24922dcddaeb08ae4b1d4c4c38 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Tumbler: qualify references to visibleItemCount with "control"Mitch Curtis2018-01-174-4/+4
| | | | | | | | This code currently works, but we prefer to use control.<property> to access properties directly. Change-Id: Ieba95bffdd0b0a9b33373524248d0ac06e9f2a3d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Make Tumbler compatible with deferred executionMitch Curtis2018-01-174-67/+161
| | | | | | | | | 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-113-17/+12
| | | | | | | | 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>
* Remove unused QQuickControlPrivate::destroyDelegate()J-P Nurmi2018-01-112-25/+0
| | | | | | Task-number: QTBUG-65341 Change-Id: Ib64ec7ede42c140483554cf75e9bc16aa147be6c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: improve Style/FallbackStyle documentationMitch Curtis2018-01-042-2/+33
| | | | | | | | | Link to relevant documentation and add entries for the Controls section to the configuration file docs. Task-number: QTBUG-65445 Change-Id: I175866167e36403475520ea4de0cb299aae542d7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Document license and attribute third party codeKai Koehne2018-01-043-0/+45
| | | | | | | | | [ChangeLog][Third-Party Code] Document constants from AngularJS in src/imports/controls/material/ElevationEffect.qml Task-number: QTBUG-65409 Change-Id: Ibd0dcf643abe036f34cea364f267fde8510057ea Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix qmlRegisterType() for RoundButtonJ-P Nurmi2018-01-041-1/+1
| | | | | | | | | RoundButton was a new type in QQC2.1 (Qt 5.8). Even though passing a non-existent revision seems to be harmless, registerTypes() becomes easier to read when we distinguish between new types and new revisions. Change-Id: I682006570f63dd0b2cb2260740fb105619e61a28 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: cleanup the internal ID from BusyIndicatorJ-P Nurmi2017-12-223-4/+28
| | | | | | | | | | | 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-224-12/+4
| | | | | Change-Id: I8ee27a0c65c9ce8c9cc48c6f59d2b34d02849be8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: update code snippet to add some content to the DrawerMitch Curtis2017-12-221-0/+5
| | | | | | Task-number: QTBUG-60550 Change-Id: I14c4d0343e2b02180bbce0546a69a7241ee6008e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Material ToolButton: fix round ripple for square buttonsJ-P Nurmi2017-12-221-1/+1
| | | | | | | | | | | | The condition for checking whether a tool button is square and thus, whether it should use a round ripple instead of a fill ripple, must be based on the size of the contents, not on the implicit size. This way, you get a round ripple for one-letter tool buttons but only if they are not stretched. Task-number: QTBUG-65052 Change-Id: I0d498dc65650f3b786b41e538748549d61f2b216 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix license headersJani Heikkinen2017-12-223-36/+54
| | | | | | | | | Old header.LGPL21 header was used at some files. Replase those with new header.LGPL one Task-number: QTBUG-57147 Change-Id: I7d707c15b33c0f14810ef8fffef9f74dd4192e64 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix deferred executionJ-P Nurmi2017-12-2120-30/+204
| | | | | | | | | | | | | | | | | | 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-217-41/+452
| | | | | | | | | | | | | | | | 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-203-4/+28
| | | | | | | | | | 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-203-9/+4
| | | | | | | | | 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>
* Examples: cleanup unnecessary/wrong property assignmentsJ-P Nurmi2017-12-209-11/+0
| | | | | Change-Id: Id7c65c9493c0e70512f3f2b167a091ece06ee5d8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Universal: cleanup unnecessary property assignmentsJ-P Nurmi2017-12-2011-20/+0
| | | | | Change-Id: I80c258ea21b4f6651e9c6e075357daabfb32d64b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: cleanup unnecessary property assignmentsJ-P Nurmi2017-12-2011-20/+0
| | | | | Change-Id: I1698392b1ef75b84d114cb19207729217abb4aed Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* StackView: don't block touchJ-P Nurmi2017-12-202-0/+11
| | | | | | | | | | | 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>
* Default: cleanup unnecessary property assignmentsJ-P Nurmi2017-12-1911-20/+0
| | | | | | | | | QQuickText's default horizontal alignment is AlignLeft. There's no need to repeat the default. Furthermore, an empty QQuickText element does not do anything, so the "visible: control.text" binding seems bogus. Change-Id: I9461301606c45a3d889ad49e62356d38fcef6f87 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* SwipeView: fix slow swiping in large viewsJ-P Nurmi2017-12-192-0/+2
| | | | | | | | | | | Flickable has a default maximumFlickVelocity of 2500 regardless of its size. When SwipeView covers the whole screen and ends up being large, 2500 pixels per second is nowhere near enough. Calculate a suitable maximum flick velocity based on the size of the view. Task-number: QTBUG-62110 Change-Id: Iaf26f586f99e7635ea931a4e3060ad4dd480a011 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popups: use deferred executionJ-P Nurmi2017-12-196-11/+51
| | | | | | | | | | | 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-1515-57/+18
| | | | | | | | | 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>
* Control: defer the execution of the background itemJ-P Nurmi2017-12-1511-9/+2
| | | | | | Task-number: QTBUG-50992 Change-Id: I6372e143c68f0a5bf7212d759281acef3c81618e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Page: use deferred executionJ-P Nurmi2017-12-142-0/+5
| | | | | Change-Id: Icb22f656893c89f61233bb547f03e63240bb8f97 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* SpinBox: use deferred executionJ-P Nurmi2017-12-142-15/+73
| | | | | | | | | | 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>
* Fix QQuickStyle::setFallbackStyle() in static buildsJ-P Nurmi2017-12-141-2/+2
| | | | | | | | | | Use QQmlFile::urlToLocalFileOrQrc() instead of QUrl::toLocalFile() to avoid assuming a local file path. In static builds, QML files are in QRC. Task-number: QTBUG-65016 Change-Id: Ide36e5269d8692620f352574c726fbd1997c0a77 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Tumbler: ensure that currentIndex animations aren't too slowMitch Curtis2017-12-141-0/+2
| | | | | | | | | | | | | | | | The default (for ListView) is 400 pixels a second, which is really slow when there are 1000 items. Set highlightMoveDuration to 1000 (one second) for both view types to ensure a constant amount of time to animate currentIndex changes. [ChangeLog][Controls][Tumbler] Made currentIndex animations take a constant amount of time (1 second) regardless of how many items are in the model. This prevents Tumblers with large amounts of items from scrolling too slowly when changing the currentIndex. Task-number: QTBUG-65165 Change-Id: I0342236e49fae346926eb7e8a5fb6ed0813e457e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* GroupBox: use deferred executionJ-P Nurmi2017-12-142-4/+36
| | | | | | Task-number: QTBUG-50992 Change-Id: I3e5c8bf7cc39fae0e882440079bb43292ace1810 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Pane: use deferred executionJ-P Nurmi2017-12-142-0/+13
| | | | | | Task-number: QTBUG-50992 Change-Id: Ibba0e79f8eaf76336dad3708606484a2846b2912 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ComboBox: use deferred executionJ-P Nurmi2017-12-145-35/+90
| | | | | | | | | | | | 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-132-4/+27
| | | | | | Task-number: QTBUG-50992 Change-Id: Ia07055d2fa3d30c91bdf3c526cf7301c7ed1ce2b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* RangeSlider: use deferred executionJ-P Nurmi2017-12-132-6/+44
| | | | | | Task-number: QTBUG-50992 Change-Id: Ibbc946c3402c65f9b100fc74dde04e4d439c8535 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TextArea: use deferred executionJ-P Nurmi2017-12-133-4/+27
| | | | | | Task-number: QTBUG-50992 Change-Id: I6d205f8ea0c90986b18b7e6cedbf347f1ce38eec Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TextField: use deferred executionJ-P Nurmi2017-12-133-4/+27
| | | | | | Task-number: QTBUG-50992 Change-Id: I99a8d97e7f25cfff398fb30e365c7b245b738c37 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Label: use deferred executionJ-P Nurmi2017-12-133-4/+27
| | | | | | Task-number: QTBUG-50992 Change-Id: I8e626d1a0585f93cbd612aca39a1e9050f5e0ed3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Dial: use deferred executionJ-P Nurmi2017-12-132-4/+27
| | | | | | Task-number: QTBUG-50992 Change-Id: I432be00d81344ce129bc8906370555b134fdf423 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>