aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material
Commit message (Collapse)AuthorAgeFilesLines
* Use qmlRegisterModuleImport() to register stylesMitch Curtis2020-08-262-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch completes the cumulative work done in previous patches. - Uses qmlRegisterModuleImport() to register styles. This has some added requirements: - Each style must now be a QML module -- that is, it must have a qmldir file. - As a result of the above, the module must be available within the QML import path in order to be found. - The various forms of accepted style names have been reduced down to one ("Material", "MyStyle", etc). See below for an explanation of why. - The following API in QQuickStyle is removed: addStylePath(), availableStyles(), path(), stylePathList(). These no longer make sense now that we reuse the existing QML import system. - Adds the tst_qquickstyleselector auto test back as "styleimports". qmlRegisterModuleImport() vs resolvedUrl() Previously we would use QQuickStyleSelector to select individual QML files based on which style was set. We'd do this once when QtQuick.Controls was first imported. With Qt 6, and the requirement that each style be a proper QML module, qmlRegisterModuleImport() was introduced. This allows us to "link" one import with another. For an example of what this looks like in practice, suppose the style was set to "MyStyle", and the fallback to "Material". The "QtQuick.Controls" import will be linked to "MyStyle", "MyStyle" to "QtQuick.Controls.Material", and as a final fallback (for controls like Action which only the Default style implements), "QtQuick.Controls.Material" to "QtQuick.Controls.Default". This is the same behavior as in Qt 5 (see qquickstyleselector.cpp): // 1) requested style (e.g. "MyStyle", included in d->selectors) // 2) fallback style (e.g. "Material", included in d->selectors) // 3) default style (empty selector, not in d->selectors) This is a necessary step to enable compilation of QML to C++. Reducing the set of accepted style names The problem In QtQuickControls2Plugin() we need to call QQuickStylePrivate::init(baseUrl()) in order to detect if the style is a custom style in QQuickStyleSpec::resolve() (by checking if the style path starts with the base URL). In Qt 5, init() is called in QtQuickControls2Plugin::registerTypes(), but in Qt 6 that's too late, because we need to call qmlRegisterModuleImport() in the constructor. qmlRegisterModuleImport() itself requires the style to have already been set in order to create the correct import URI ("QtQuick.Controls.X" for built-in styles, "MyCustomStyle" for custom styles). The solution By reducing the valid forms for style names down to one: ./myapp -style MyStyle we solve the problem of needing baseUrl() to determine if the style is a custom style or not, but needing to call it too early (since we now call qmlRegisterModuleImport() in QtQuickControls2Plugin(), which itself requires the style to have already been set). baseUrl() can't have been set before the constructor is finished. All of the various forms for _setting_ a style are still valid; environment variables, qtquickcontrols2.conf, etc. [ChangeLog][Important Behavior Changes] Custom styles must now have a qmldir that lists the files that the style implements. For example, for a style that only implements Button: --- module MyStyle Button 1.0 Button.qml --- In addition, there is now only one valid, case-sensitive form for style names: "Material", "MyStyle", etc. These changes are done to help enable the compilation of QML code to C++, as well as improve tooling capabilities. [ChangeLog][Important Behavior Changes] The following API was removed: - QQuickStyle::addStylePath() - QQuickStyle::availableStyles() - QQuickStyle::path() - QQuickStyle::stylePathList() - QT_QUICK_CONTROLS_STYLE_PATH This API is no longer necessary and/or able to be provided now that styles are treated as regular QML modules. Task-number: QTBUG-82922 Change-Id: I3b281131903c7c3c1cf0616eb7486a872dccd730 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Convert remaining imperative type registration to declarativeMitch Curtis2020-08-262-20/+3
| | | | | | Task-number: QTBUG-82922 Change-Id: I34e9f32d5f695aaac7acf6b4aac30e8a2311e0cf Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* List "privately" registered QML files in the qmldir for each styleMitch Curtis2020-08-261-0/+9
| | | | | | | | This is required in order to move away from imperative registration. Task-number: QTBUG-82922 Change-Id: I4b2a727d69e66c29629920a3711548e02f72ce49 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* List publicly registered QML files in the qmldir for each styleMitch Curtis2020-08-261-0/+62
| | | | | | | | | | | | | | | | | | | This is required in order to move away from imperative registration. Some styles do not have implementations for all types, in which case they fall back to the Default style. The list of those types are: AbstractButton 2.0 AbstractButton.qml Action 2.3 Action.qml ActionGroup 2.3 ActionGroup.qml ButtonGroup 2.0 ButtonGroup.qml Container 2.0 Container.qml Control 2.0 Control.qml ScrollView 2.2 ScrollView.qml (except Imagine) Task-number: QTBUG-82922 Change-Id: If51c8232d7a8b12f6d1f988cc7ce2d8edca1e467 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove all version numbers from QML importsMitch Curtis2020-08-2658-256/+256
| | | | | | | | | As of Qt 6, the latest version will be used by default. This saves us a lot of effort in terms of version bumps. Task-number: QTBUG-82922 Change-Id: I74eba8185ec3ccc75bc293d4b2ea87d59e2d9928 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove ".2" from TARGETPATH, resource prefixes, etc.Mitch Curtis2020-08-262-2/+2
| | | | | | | | | | | | Qt Quick Controls 1 will be removed in Qt 6, so now we can have the simplified path for ourselves. Having the .2 in the path causes issues for importing now that the version is being bumped to 6. Task-number: QTBUG-82922 Change-Id: I0b92cdd44c42c19b1c82e7b9a7959b86ac26c6e2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Register C++ types declarativelyMitch Curtis2020-08-2626-40/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adapt to the new way of registering C++ types. The types need to be seen at compile time so that code can be generated that invokes them. This patch: - Adds QML_* macros where applicable. - Adapts the build system files to the new way of registering modules. - Splits up the QtQuick.Controls[.*].impl files into their own plugins, as we can only register one QML module per .pro file. - Removes C++ type registration calls in every plugin. - Moves private types from src/quickcontrols2/quickcontrols2.pro to src/quickcontrols2/impl/quickcontrols2-impl.pro. Some of these types need to be exposed to QML, but quickcontrols2.pro is already in use to declare the QtQuick.Controls import (and also provides the public C++ QQuickStyle API), and the new QML_IMPORT_NAME/VERSION syntax only allows one module per project. As some of the types that need to be exposed to QML are also referenced by some C++ code (e.g. tests, etc.), we just move all of the private types to the new library. Follow-up patches will register the QML types declaratively. Task-number: QTBUG-82922 Change-Id: Iaf9ee106237d61701d57a8896f3822304c8151a6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Stop using resolvedUrl() to resolve QML filesMitch Curtis2020-08-261-1/+0
| | | | | | | | | | | | | | | | | | | | This is necessary to move away from imperative type registration of QML files (i.e. qmlRegisterType()). A later patch will use qmlRegisterModuleImport() to register the QtQuick.Controls import with the style set by the user, which will require each style to have a qmldir listing the files that it provides. Note that some plugins still register QML files, but these registrations will have to stay for now until we can split out "impl" plugins in later patches where those files can be registered. tst_qquickstyleselector will be added back in some other form in a follow-up patch. Task-number: QTBUG-82922 Change-Id: I8182533d9912ed493efda6eb91c69fc064af07ee Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove another binding to parentMitch Curtis2020-07-151-1/+1
| | | | | | | | | | | | | | Similar to what was done in 456d26e97ec7745fdbd1afaaaa6c1dc217eca060. The warning was: Material/ComboBox.qml:68: TypeError: Cannot read property 'Material' of null Task-number: QTBUG-82989 Pick-to: 5.15 Change-Id: Id82d62d6aca0c0e517d6f8630c51f54739aea95f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* ApplicationWindow: remove deprecated overlay APIMitch Curtis2020-06-081-10/+0
| | | | | | | | | | [ChangeLog][Controls][ApplicationWindow] The deprecated overlay properties and attached API were removed. Use the Overlay attached type instead. Task-number: QTBUG-84715 Change-Id: I0781ea55ea502ffe5277385e82492291724d2090 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add missing paletteChanged() to setForeground() in Material styleJoni Poikelin2020-06-081-0/+1
| | | | | | Pick-to: 5.15 Change-Id: I7396885688c6091a948f2865ff716e84f7f5195b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-05-141-1/+2
|\ | | | | | | Change-Id: I24ff9bec33e0bd8785e3d571212a7506b6501854
| * Update plugins.qmltypes for 5.15Jani Heikkinen2020-04-151-1/+2
| | | | | | | | | | | | Task-number: QTBUG-82253 Change-Id: I93ae7b51b902050020cf7a79510b8325060181c5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Material: revision sliderDisabledColorv5.15.0-beta4v5.15.0-beta3Mitch Curtis2020-03-311-1/+1
| | | | | | | | | | | | | | | | | | This amends 0d5a43fa8. Cherry-picked from branch: dev Change-Id: I68c500ae874c92467b414dbf37eec9d55b3c730f Reviewed-by: cherrypickbot
* | Dial: remove unnecessary id qualificationsMitch Curtis2020-05-131-2/+2
| | | | | | | | | | | | | | | | | | This amends 467aa59a8. Pick-to: 5.15 Change-Id: If162e6fe6f3087e905457d23248e95ae31726e4d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Remove bindings to parent in delegatesMitch Curtis2020-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until we've decided whether to a) document that properties of parent should not be bound to in delegates or b) fix the warning that results from doing so after 8c72e634b3b0eacbfdee883bfc34994d3c19ed77, we can pre-emptively clean up a few places where it happens. Task-number: QTBUG-81976 Task-number: QTBUG-82393 Task-number: QTBUG-82989 Pick-to: 5.15 Change-Id: I1e610613f6016ec1b9cf9ca33cdfb15d384731a8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Material: revision sliderDisabledColorMitch Curtis2020-03-311-1/+1
| | | | | | | | | | | | | | | | This amends 0d5a43fa8. Pick-to: 5.15 Change-Id: I68c500ae874c92467b414dbf37eec9d55b3c730f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-313-3/+9
|\| | | | | | | Change-Id: Ie09cfdd17b00e56f3ba8677d25b24417dd4e42f6
| * HeaderView: Add support for list based modelsAndy Shaw2020-03-242-2/+6
| | | | | | | | | | Change-Id: I411136bd2b9a277d84a7c68c55bb1c317b6cc9d2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Account for the padding around a menu when checking if it is interactiveAndy Shaw2020-03-181-1/+3
| | | | | | | | | | | | | | | | | | | | If there is padding around the menu then it will mean the available height is smaller than the containing item and as such should be interactive. Fixes: QTBUG-82473 Change-Id: Ie3e7568ab66aa3da93e5448c1a27c9bd2a5e486a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix Qt 6 to-do comments in QML filesMitch Curtis2020-03-232-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove what appears to be code for backwards compatibility in the sizing of certain controls. Removing the code shows no discernible difference in the appearance of those controls. [ChangeLog][Controls][Tumbler] implicitWidth and implicitHeight must now be provided for Tumbler's contentItem, as with all other controls. Change-Id: Id858b6d13bfd81d8f30be57290fb260404652a4c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-03-185-17/+28
|\ \
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-185-17/+28
| |\| | | | | | | | | | Change-Id: I88990095b97a4088f9fda6c9496fd69d4556f6a1
| | * Material: Make Slider's track accent colored and semi-transparentPaweł Gronowski2020-03-171-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the Material Design guidelines Slider's track should be accent colored and semi-transparent. Additionally it should be a bit thicker. The original ticket in the bug tracker mentions it to be 2px 2px but I think that the 4px makes it look a lot more like the one presented in the guidelines (https://material.io/components/sliders/). Task-number: QTBUG-70768 Fixes: QTBUG-70768 Change-Id: I062c0938297ae877b37605b6d536e11b464d477f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Material: Make RangeSlider's track accent colored and semi-transparentPaweł Gronowski2020-03-171-8/+9
| | | | | | | | | | | | | | | | | | | | | To match the Slider's appearance. Change-Id: Ida7a03877c7b8a23508c532dbb275f96bc137742 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Material: Change RangeSlider's color to grey when not enabledPaweł Gronowski2020-03-171-1/+1
| | | | | | | | | | | | | | | Change-Id: I0cc390e1a46242ef22bb7d5460701e7b14087ee7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Material: Change slider's color to grey when not enabledPaweł Gronowski2020-03-174-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Slider was not enabled it would look exactly the same as when enabled. [ChangeLog][Controls][Material] Add visual distinction between an enabled and not enabled slider. Task-number: QTBUG-70768 Change-Id: If0d7e5adc19d8bc22a810cb2ba4e57b657ab48d4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | CMake: Regenerate projectswip/cmakeAlexandru Croitor2020-03-171-0/+176
| | | | | | | | | | | | | | | | | | Change-Id: Ifd6b2289de6465a010f5f2a32789221767b4d5be Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-176-8/+185
|\| | | | | | | | | | | Change-Id: Ieb9bcfba9651d646509afd065ce2389ef74448cc
| * | Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-103-1/+137
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/qtquickcontrols2plugin.cpp Change-Id: Ifc09ea9f71fdba119fe8eed99f0bdcb402444f27
| | * HeaderView: set implicitSize on the style itemsv5.15.0-beta2Richard Moe Gustavsen2020-03-102-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By setting an implicit size, the user don't need to set a width or height on a HeaderView himself, but it will get the default size recommended by the style. By doing it the way it's done in the patch we achieve the following: 1. A HeaderView will by default be resized to be the same size as the delegate. 2. If the application sets a size on HeaderView it that is larger than the implicit size of the delegate, the delegate will be resized to have the same size (effectively filling out the free space in the header). 3. If the size of HeaderView is smaller than the implicit size of the delegate, the delegate will simply be clipped. (effectivly saying that the implicitSize of the delegate is also it's minimum size). If this is not acceptable for the application, it will need to use a custom delegate. Since a HeaderView delegate is a component and not an item, it should not be a part of the sanity checks we do to avoid using internal IDs. Hence we blacklist until we have a better way of handling such cases. Task-number: QTPM-1300 Change-Id: I30ca3e13ce5e1371b60f5c4ecf742a7d7e794a36 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Add HorizontalHeaderView and VerticalHeaderViewv5.15.0-alpha1Yulong Bai2020-02-113-1/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Controls] Add HorizontalHeaderView and VerticalHeaderView. They are controls associated with TableView. Support flicking synchronization Support default, fusion, imagine, material and universal delegate styles. Fixes: QTPM-1300 Change-Id: Ie3f913dd616cda0d4e5a22a3d95baf71692370fe Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-082-0/+40
| |\| | | | | | | | | | Change-Id: I4b20284eb05b6277c758a1ab5579b803db9a84ca
| | * Upgrade qsb files to version 4Laszlo Agocs2020-01-212-0/+40
| | | | | | | | | | | | | | | | | | | | | Also add a compile.bat following the qtdeclarative pattern. Change-Id: Id2350ce6650ca22c1c6403a565c33137ff5a3c64 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-141-7/+8
| |\| | | | | | | | | | Change-Id: I53a6326a91c2de5a6016df7322df4a6159f2330e
| | * ComboBox: add selectTextByMouse propertyMitch Curtis2019-12-121-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows configuring the selectByMouse property of the underlying TextField for editable combo boxes. Named selectTextByMouse instead of selectByMouse to avoid confusion with selection of the items themselves. [ChangeLog][Controls][ComboBox] Added selectTextByMouse property. Change-Id: I852e4cd44ebe6b2a1ed2535513ea2fc35cbe0a32 Fixes: QTBUG-71406 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-2517-4/+181
|\| | | | | | | | | | | Change-Id: I61919fabd4a3a07ed374f2c3c1fae2d589d6e124
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-232-1/+2
| |\| | | | | | | | | | Change-Id: I65b34cc9ac31ecf2b768ec8e45ac635df7e9cba4
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-162-1/+2
| | |\ | | | | | | | | | | | | Change-Id: I932a1b1606975265e6affd50e161e58737404a0d
| | | * Make ToolTips wrapMitch Curtis2019-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise the text will go outside the window. Change-Id: I3d50a195b1ee6c9b5d49952ef6c49d17c61372fa Fixes: QTBUG-62350 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * SwipeView: fix issue where child items couldn't get focusMitch Curtis2019-11-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the focus property of the contentItem (ListView) to the focus property of the SwipeView itself. Change-Id: Ic410f7fb8db9fbb758b956dfe07e1b4265f5f687 Fixes: QTBUG-62401 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-1612-0/+0
| |\| | | | | | | | | | | | | | Change-Id: I647fa31fafdaea46c341c515f97b7f793ddf4b31
| | * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-0912-0/+0
| | |\| | | | | | | | | | | | | Change-Id: Ib14b8c77cefe7aaf5b11483d9a30b2ef05314598
| | | * Merge remote-tracking branch 'origin/5.13' into 5.14v5.14.0-beta3Qt Forward Merge Bot2019-11-0512-0/+0
| | | |\ | | | | | | | | | | | | | | | Change-Id: I4b970036bdb5d312b0dc5cb1bcbd8e161e3d4c7e
| | | | * Run optipng on all imagesMitch Curtis2019-11-0412-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | find . -name "*.png" -exec optipng -o 7 -strip all {} \; Change-Id: I2238b2dd38813d33ed48d79817f872f922cfa28d Fixes: QTBUG-79275 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-021-1/+177
| |\| | | | | | | | | | | | | | | | | | Change-Id: I89a29c7040e233314885eb37731f53dba8ed6c1a
| | * | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-261-1/+177
| | |\| | | | | | | | | | | | | | | | | Change-Id: If43d5edea9ec0d4beaa3336b3e9aeefc698c5e6b
| | | * | Update plugins.qmltypes for 5.14Kai Koehne2019-10-211-1/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-78690 Change-Id: I0e421232f4335a7a351562f23134eccdd0b1c674 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-192-2/+2
| |\| | | | | | | | | | | | | | | | | | Change-Id: I770f99d20878ddf16ab3f4b1a5422e7192622f64
| | * | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-122-2/+2
| | |\| | | | | | | | | | | | | | | | | Change-Id: I342393f83eab161df8ad6323051c5fadb4cf9ddc