aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/universal
Commit message (Collapse)AuthorAgeFilesLines
* ScrollBar: fix flashing in Material & Universal stylesJ-P Nurmi2017-06-161-0/+1
| | | | | | | | | | | | | | | Ensure a suitable starting opacity for the inactive state transition. When calling increase() and decrease() from key-handlers, as the docs suggest, we flash the scrollbar by turning the active state on, and then back off immediately. If there is an opacity animation when the scrollbar becomes active (Material & Universal), the opacity animation is stopped right away, because the state changes back to inactive. This state changing trick worked only with the Default style, because it changes the opacity without animating when it becomes active. Change-Id: I4117de79c7145a710c0b6c43873ca2336b64e21e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ComboBox: fix empty popup being shown after model is clearedMitch Curtis2017-05-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, ComboBox's popup is sized vertically in this way: implicitHeight: contentItem.implicitHeight Adding an item to a ComboBox with an empty model and then opening the popup results in the implicitHeight being used in the line below (in QQuickPopupPositioner::reposition()): QRectF rect(p->allowHorizontalMove ? p->x : popupItem->x(), p->allowVerticalMove ? p->y : popupItem->y(), !p->hasWidth && iw > 0 ? iw : w, !p->hasHeight && ih > 0 ? ih : h); An explicit height was never set on the popup, and ih (the implicitHeight of the popupItem) is greater than 0. This is fine. However, when a ComboBox's popup item grows large enough that it has to be resized to fit within the window, its explicit height is set. The problem occurs when the model is then cleared, as the implicit height of the popup item becomes 0. So, while "!p->hasHeight" is still true, "ih > 0" is not, and the explicit height of the popup item is used, which is still the previous "let's fill the entire height of the window" size. To fix this, we bind the height of the popup to a different expression: height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) This ensures that the popup has a zero height when the ListView's implicitHeight is zero (i.e the model is empty), and a height that fits within the window in all other cases. Ideally, we'd have a maximumHeight property that controls this, but for 5.9, we have to fix it this way. Task-number: QTBUG-60684 Change-Id: Ied94c79bb7b0e693be34e9c7282d991f6f704770 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Enable build time QML caching for the Material & Universal stylesJ-P Nurmi2017-05-201-0/+1
| | | | | | | | | | | | | We had troubles enabling Qt Quick Compiler support for these styles, because we wouldn't be able to select style-specific .qml files from the resources of an unloaded/uninstantiated plugin. Build-time QML caching doesn't seem to be a problem because the .qmlc files are not built into resources but are available on the file system. Task-number: QTBUG-58571 Change-Id: I93e7a82a72c4bcf3a92c7ca12186f24a22d4d342 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* ApplicationWindow: fix access to revisioned members in base classesJ-P Nurmi2017-05-181-0/+1
| | | | | | | | | | | | | | | The inheritance hierarcy is: QWindow <- QQuickWindow <- QQuickWindowQmlImpl <- QQuickAppWindow Each base class has its own set of revisioned members. Import the revisioned members in the base classes to the templates/controls namespace by calling qmlRegisterRevision() with the revision of the base class and the respective templates/controls version. Task-number: QTBUG-60893 Change-Id: I6d91209dc5b2eb17c2b3845675a5ddbffb7e8b72 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Universal: add missing importsStephan Binner2017-04-294-0/+4
| | | | | | | | | | All types that use internal types (such as XxxIndicator) must explicitly import the namespace. Otherwise the QML engine might end up doing an implicit import, which leads to URI mismatch. Task-number: QTBUG-57618 Change-Id: Ie803d32bdef287f076be233777d8fe933d5f50e2 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Add .qml files to OTHER_FILES to force them visible in Qt CreatorJ-P Nurmi2017-04-201-3/+4
| | | | | Change-Id: I50f26b1a0fd5d6bc79e125e46fe9a546a3441db3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Cleanup unused qdoc markersJ-P Nurmi2017-04-181-2/+0
| | | | | Change-Id: Ia42868a2e322aef2ae9a98049694f630b3458bcc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Universal/RadioDelegate: remove spurious control-propertyJ-P Nurmi2017-04-181-2/+0
| | | | | | | Apparently slipped in by accident in b663020c. Change-Id: Ie0a292b6c230c4593c76165d2a78b946bb38351a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ComboBox: cleanup superfluous QtQuick.Window importsJ-P Nurmi2017-03-281-1/+0
| | | | | | | The Window attached property has not been used since 3bbd90c7. Change-Id: I09e0c620aa83533c98316f50d6bfe3fd292761d4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Universal/SwipeDelegate: remove native text rendering leftoverJ-P Nurmi2017-03-281-1/+0
| | | | | | | | Native text rendering was removed in 3f5a66eb at the same time SwipeDelegate was being developed. Change-Id: I14eb1f335963abb9ead9450d62262990a3abc7d9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popup.qml: fix typoJ-P Nurmi2017-03-231-1/+1
| | | | | | | Task-number: QTBUG-59661 Change-Id: I35627bafc57266cb7b2842fe02765536ca7eecba Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-101-0/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp src/quicktemplates2/qquicktextarea.cpp src/quicktemplates2/qquicktextfield.cpp Change-Id: Ie80a2d3bcbb961a38e3dffa247547d3d860c231a
| * Add missing QML type registrationsJ-P Nurmi2017-02-201-0/+1
| | | | | | | | | | | | | | | | For the internal Radio and CheckIndicator types. Task-number: QTBUG-59026 Change-Id: I7e34f29e33ebd3d748892df0ba1592fe8ae5ed44 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add missing includesJ-P Nurmi2017-02-242-0/+2
| | | | | | | | | | | | | | Found while doing a -no-accessibility build. Change-Id: I9772316eed3d544b21926970371a590ef2c15bef Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Make styles configurable featuresJ-P Nurmi2017-02-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ./configure [...] Qt Quick Controls 2: Styles ................................. Default Material Universal Supports both syntaxes: -(no-)style-[material|universal] -(no-)feature-quickcontrols2-[material|universal] Change-Id: I011cc38e5752d2c718376ca7493940271920b3e1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix build with -no-feature-settingsJ-P Nurmi2017-01-311-0/+2
| | | | | | | | | | Change-Id: I204c50539288df16c4d4010e91c8ecc60f202ec6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Update IMPORT_VERSION in the .pro filesJ-P Nurmi2017-01-241-1/+1
| | | | | | | | | | Change-Id: I9546ee274e5376151e9f5faffda87182f2e10188 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add ScrollBar::policyJ-P Nurmi2017-01-201-2/+3
| | | | | | | | | | | | | | | | [ChangeLog][Controls][ScrollBar] Added a policy-property, which holds whether the scroll bar is shown always/never/as needed (default). Change-Id: Ibe25edaef04a7926bc12c59913efa7a3d43a5ccf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add ScrollBar::interactiveJ-P Nurmi2017-01-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Controls][ScrollBar] Added an interactive-property. A non-interactive ScrollBar is visually and behaviorally similar to ScrollIndicator. This property is useful for switching between typical mouse- and touch-orientated UIs with interactive and non- interactive scroll bars, respectively. Change-Id: Ie98bfa0b5bba94a9751baf3c65f17b850b58fd1f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QtQuickControls2: Use the newly-introduced qmlWarning instead of qmlInfoRobin Burchell2017-01-131-2/+2
| | | | | | | | | | | | | | | | qmlInfo will shortly be returning info-level messages (as the name hints), rather than warning level messages. Change-Id: I94123464b12b30a4ba085cfb7b606bc26df9b76e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-1157-57/+57
|\| | | | | | | Change-Id: If797ac58344b20e8de4379343131c097247ba2f2
| * Welcome to 2017J-P Nurmi2017-01-0957-57/+57
| | | | | | | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Editors: fix placeholder text alignmentJ-P Nurmi2017-01-102-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal QQuickPlaceholderText creates an "implicit binding" to the editor's horizontalAlignment, meaning that the placeholder respects the editor's horizontal alignment when explicitly set, and otherwise determines the alignment from the placeholder text's visual direction. [ChangeLog][Controls][TextField] Fixed the horizontal alignment of the placeholder text in right-to-left UIs. [ChangeLog][Controls][TextArea] Fixed the horizontal alignment of the placeholder text in right-to-left UIs. Task-number: QTBUG-55999 Change-Id: If1a8596c35c1920874996277520f1c54430c5f69 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTabBar: fix implicit size calculationJ-P Nurmi2017-01-101-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, the implicit size of TabBar was calculated based on the content size of the ListView that TabBar uses internally. The problem was that ListView calculates the content size based on the explicit size of the items. There was a circular dependency, because TabBar resized the tabs to the size of the view. To avoid the circular dependency, TabBar now calculates the content size based on the total implicit size of the tabs. As before, explicit size is respected for tabs that have it set. [ChangeLog][Controls][TabBar] Added contentWidth and contentHeight properties that are automatically calculated based on the total size of the tab items, but can be manually overridden if desired. This fixes an issue that TabBar was not able to reliably calculate an implicit size, and could in certain scenarios enter an infinite loop due to a circular dependency between the items' sizes and the tabbar's size. Task-number: QTBUG-57858 Change-Id: Ie303cbc54247e87b0affc6bf32c7bf99acea4571 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | qmldir: update the versions of the module dependenciesJ-P Nurmi2017-01-051-1/+1
| | | | | | | | | | Change-Id: Ia4675c1937df2bfa797bc8d0e34d4a9c58232588 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add DelayButtonJ-P Nurmi2017-01-022-0/+97
| | | | | | | | | | | | | | [ChangeLog][Controls][DelayButton] Added DelayButton. Change-Id: I94820dfb41ba9b90f0a29cda01ac476b54cf3de8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-021-1/+1
|\| | | | | | | | | | | | | Conflicts: src/imports/platform/qquickplatformmenuitem.cpp Change-Id: I4d399aa81a31112edf6030b52ba5d68828f9729d
| * Bump style plugin dependencies to QtQuick.Controls 2.1Konstantin Ritt2016-12-281-1/+1
| | | | | | | | | | Change-Id: I316ec8deab791c0e8ebf0bbb9bb1a07e8aacad6b Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | SwipeDelegate: rename swipe.rebound to swipe.transitionJ-P Nurmi2016-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "rebound" name originates from Flickable::rebound, but for swipe delegate the transition is not only applied on release, but also when calling swipe.open() or swipe.close(). Therefore the "rebound" name feels a bit off in this context. Furthermore, this patch adds the missing docs and a changelog entry. [ChangeLog][Controls][SwipeDelegate] Added a swipe.transition property that holds the transition that is applied when a swipe is released, or swipe.open() or swipe.close() is called. Change-Id: Ic38ec850c64dd21b8d9deb08609172c6cb0f6d71 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-12-201-0/+1
|\| | | | | | | | | | | | | | | Conflicts: src/imports/controls/material/DialogButtonBox.qml src/imports/controls/universal/DialogButtonBox.qml Change-Id: I16cbf9912a3526783c21a6f30996f83fce9e02c3
| * Merge remote-tracking branch 'origin/5.8.0' into 5.8J-P Nurmi2016-12-201-0/+1
| |\ | | | | | | | | | Change-Id: I8544063279de0ce12438e867e6b7767b00e72f11
| | * DialogButtonBox: add missing importv5.8.0-rc1J-P Nurmi2016-12-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | DialogButtonBox uses the Button-type from the QtQuick.Controls namespace, but did not import it. Change-Id: Ibe635461e280a8f8a78a52a2454fd8524a90a7e1 Task-number: QTBUG-57618 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | SpinBox: fix input method hints to get the appropriate VKBJ-P Nurmi2016-11-291-1/+1
| |/ | | | | | | | | | | | | | | SpinBox operates on integers. Task-number: QTBUG-56837 Change-Id: Ib77cded8c4483fa78816d004692cacb3532deedd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Bump the QtQuick import versions in the stylesJ-P Nurmi2016-12-1946-46/+46
| | | | | | | | | | | | | | Qt 5.9 == QtQuick 2.9 Change-Id: I7d4f749645011c4e78bdafe80824b83bd166e7c7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | SwipeDelegate: transition swipe.positionJ-P Nurmi2016-12-141-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the value of swipe.position jumped on mouse/touch release, or when open() or close() was called. Transitioning the swipe.position value smoothly to the target value makes it possible to use it as opacity/scale/etc. for the side items. Notice that this is backwards compatible with the old behavior. If no transition is set, the value jumps the same way it did before. In that case, Behavior on x makes the movement smooth. Task-number: QTBUG-57242 Change-Id: Id9c06b5b08fa73f2f575787e16dc6e20e4ccb545 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | SpinBox: add inputMethodHints and inputMethodComposingJ-P Nurmi2016-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Needed for controlling the input method. Editors and editable ComboBox have these also. [ChangeLog][Controls][SpinBox] Added inputMethodHints and inputMethodComposing properties for controlling the input method when using editable spin boxes. Task-number: QTBUG-56837 Change-Id: I1df21341c9a10c1baa1eaa259a5bbab7145e87c8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add ComboBox::editableJ-P Nurmi2016-11-241-11/+33
| | | | | | | | | | | | | | | | [ChangeLog][Controls][ComboBox] Added editable property Task-number: QTBUG-53876 Change-Id: I1cb035b3bb4c63f7935f08298814005fad51b5eb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Update import versions in src/import/controls - part IIJ-P Nurmi2016-11-2340-40/+40
| | | | | | | | | | | | | | The templates imports were missed in fb7c9541, sorry. Change-Id: I9742f1a86b01083ae1b7c6ae48b43098be8385c5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Update import versions in src/import/controlsJ-P Nurmi2016-11-2346-55/+55
| | | | | | | | | | Change-Id: Ic6cd0450a13b965578a0ab8f590270f4e52ffca6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Make sure the appropriate import versions are always availableJ-P Nurmi2016-11-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Utilize the newly introduced qmlRegisterModule() to automatically register the import version that matches the Qt version that is used to build the module. Now we can remove the artificial qmlRegisterRevision() calls, which were added just to make certain import versions available, even if there was no such revision. Change-Id: Ic3887c221c69b6cd299853d8d5869b8af7a314ec Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | ComboBox: add more padding to the indicatorsJ-P Nurmi2016-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the upcoming editable comboboxes, only the area covered by the indicator acts as a pressable button. The rest is editor area, which gains focus on press, but doesn't trigger the popup. The button must be large enough to be usable on touch. - Default: the width has been increased from 28 to 40 - Material: the width has been increased from 24 to 40 - Universal: the width is already 32 (which matches with SpinBox) Task-number: QTBUG-53876 Change-Id: I2312e92947826b03fa28da2e9e9d844325fc7896 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickComboBox: ensure a parent for delegatesJ-P Nurmi2016-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to replace the "width: control.popup.width" expressions with "width: parent.width" to avoid explicit references to the popup. Next, we are ready to defer the execution of the popup until it becomes visible or is accessed by the user. Without the parent item fix, ComboBox throws an error: ComboBox.qml:58: TypeError: Cannot read property of null ...and tst_snippets fails => tested implicitly. :) Change-Id: Ib9cfcf7558addbe3403d835d3ae11b6c11c2f0cb Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Add QQuickComboBox::downJ-P Nurmi2016-11-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | This allows us to replace all "control.pressed || popup.visible" expressions with "control.down", and takes us one step closer to deferred popop execution as mentioned in the previous commit. In order to be able to defer the popup execution, we must get rid of such explicit references to the popup. Change-Id: Ifa7ecf8201912d3ec1bca232e2cf600e3886715e Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Whitespace cleanupsJ-P Nurmi2016-11-031-1/+1
| | | | | | | | | | Change-Id: Ia075694a7dc43d72d07221b569467fcebdb411fb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | ComboBox: prepare the internal layouts for editable combosJ-P Nurmi2016-11-015-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The text field of an editable ComboBox must cover the whole control excluding the indicator button. This ensures that user interaction works as expected over the whole editor area (there must be no "dead" paddings), and that the whole editor area gets the appropriate caret or ibeam mouse cursor. Previously, the indicator was laid out inside/over the content item. To help with getting the layout right, this change injects empty padding into the indicator images of the Universal and Material styles (the Default style already had padding). Task-number: QTBUG-53876 Change-Id: I62e10ffb7f5ed4559523513f04ff7e2ea0e57ef5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-10-313-8/+26
|\| | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickpopup.cpp src/quicktemplates2/qquickpopup_p_p.h Change-Id: I33241dfd15a320e6ae2f0c056252b0ec6be7c6f6
| * Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-311-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/CheckIndicator.qml src/imports/controls/RadioIndicator.qml src/imports/controls/RangeSlider.qml src/imports/controls/Slider.qml src/imports/controls/SwitchIndicator.qml Change-Id: I32612d2f905ffa02dbaedbb1f84c8237fbd66db3
| | * Replace QStringLiteral with QLatin1String in the proxy themesJ-P Nurmi2016-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us, in theory, to test multiple styles in the same process by calling qmlClearTypeRegistrations() between each style test round. When QML types are cleared, QML plugins are unloaded, and the current style plugin's proxy platform theme is destroyed. It leads to a nasty crash if there are fonts stored in the Qt font database that have their family names stored in the read-only data of an unloaded plugin. Change-Id: I32a70077ac4502e16a753fb68f7efeef35d239b5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | Popup: add spacing support for Dialogv5.8.0-beta1J-P Nurmi2016-10-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps to get the dialog layout right (a separate follow-up commit), because we don't need to mess with the paddings of the header, content, and footer, based on their existence and visibility, but we can also adjust the spacing which gets automatically added between the building blocks when they exist and are visible. Change-Id: Ie8b587eeb9d0fb4a8f42baf957879d40bbd3385c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | Page: support spacingJ-P Nurmi2016-10-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add spacing support into QQuickPageLayout. Having spacing and padding separately gives more fine-grained control over the layout. Spacing is inserted between the header, content, and footer, but only when the respective building blocks are visible. Change-Id: Ia26a4c33c2756a603ca6d53aefac3a66414b36d3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>