aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols2
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.11' into devJ-P Nurmi2018-03-231-3/+3
|\ | | | | | | | | | | | | | | Conflicts: src/quickcontrols2/qquickstyle.cpp tests/auto/controls/data/tst_popup.qml Change-Id: I7b7bb5f9c63b32eef65c9b2e68f56baa3da69cff
| * QQuickStyle: use local 8-bit for paths from env varsJ-P Nurmi2018-03-231-4/+4
| | | | | | | | | | | | | | We must not assume that paths are Latin-1 strings. Change-Id: I13814bf29c9ebb12b71e5c559843589946a7ecac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-201-1/+2
|\| | | | | | | Change-Id: I69ada9110df30ea5f20710a2d1e6ac6b6a448b21
| * Avoid crashes when the qquickcontrols2 plugin gets unloadedLars Knoll2018-03-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The styleSpec() can be a nullptr in some cases, so test for that before calling reset() on it. Fixes a crash on exit in the qqmlextensionsplugin autotest of qtdeclarative if qtquickcontrols2 has been compiled. Change-Id: Ic43cbec57b36f9a0181d3b0c50d4a19236b5870e Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix QQuickTheme::font() and palette()J-P Nurmi2018-03-011-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Respect fonts and palettes from :/qtquickcontrols2.conf, but don't blatantly override the platform fonts and palettes with null values if the fonts and palettes are not set in :/qtquickcontrols2.conf. Even though fonts and palettes have technically same problem, testing the system palette is hard with 5.11 since QQuickDefaultTheme is a platform proxy theme and provides a custom system palette. It should be possible to have tst_palette::systemPalette() in dev, though, where we have removed the inheritance between QQuickTheme and QPlatformTheme. Task-number: QTBUG-66430 Change-Id: I6dfe678ccdc7e3990320c120612cfcc68723264d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * QQuickStyle: fix and test QT_QUICK_CONTROLS_CONFJ-P Nurmi2018-02-201-0/+1
| | | | | | | | | | | | | | | | Reset QT_QUICK_CONTROLS_CONF when appropriate, and add some tests too since the environment variable is now public and documented. Change-Id: I09fba950de7c34f22c4cf802ea5c0a337c84f0bd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickStyle: add API for managing style pathsJ-P Nurmi2018-03-162-2/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to be able to use/refer to/select styles by name: - ./myapp -style Glossy - :/qtquickcontrols2.conf: [Controls] Style=Glossy - QT_QUICK_CONTROLS_STYLE=Glossy ./myapp the style needs to be available in a place where QQC2 can find it by the given name. Normally, QQC2 scans for available styles in the QT_INSTALL_QML/QtQuick/Controls.2/ directory, where all the built-in styles reside. However, 3rd party styles may want to install styles into their own namespace, especially if they offer style-specific API. If a style is installed elsewhere, QQC2 needs to be made aware of the style path to make it possible to locate the style. Previously, the QT_QUICK_CONTROLS_STYLE_PATH environment variable was the only way. This adds proper C++ API, inspired by QQmlEngine's importPathList and pluginPathList, to manage QQC2 style paths. [ChangeLog][Controls][QQuickStyle] Added stylePathList() and addStylePath() methods for managing the list of directories where Qt Quick Controls 2 searches for available styles. Task-number: QTBUG-67062 Change-Id: I1e85b5e09ba869483c0937ac61a0a2dcfc8e774e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTheme: cleanup the APIJ-P Nurmi2018-03-151-7/+4
| | | | | | | | | | | | Task-number: QTBUG-67062 Change-Id: Id2f821bd41b72f7bce9885295e89c322eb3332f4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add "qt.quick.controls.style" logging category for style lookupJ-P Nurmi2018-03-131-1/+7
| | | | | | | | | | | | | | | | | | | | Helps to debug where the .qml files are selected from. Especially with the upcoming Qt Quick Compiler and QRC changes, it will be important to be able to verify which files are being used, but this also helps investigating issues with custom styles. Change-Id: I2b2b4f57b3288e0ab204c624ef6d8eb92268698b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Refactor QQuickStyleSelectorJ-P Nurmi2018-03-135-90/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of trying to determine a single base URL based on the import URI of the plugin, and whether built in static mode, provide a list of paths where to lookup styles, in priority order: - requested style path (-style /path/to/style) - QT_QUICK_CONTROLS_STYLE_PATH environment variable - QT_INSTALL_QML/QtQuick/Controls.2/ - qrc://qt-project.org/imports/QtQuick/Controls.2/ Furthermore, provide the requested style name and the fallback style name as a simple list of selectors. The lookup order is: 1) requested style 2) fallback style 3) default style As a result, QQuickStyleSelector implementation is a lot simpler, completely independent of QQuickStyle, and the style lookup works regardless of whether the files are in QRC or on the file system. This allows us to utilize QRC and the Qt Quick Compiler in the future. Note: two data rows in tst_QQuickStyleSelector::select_data() had to be fixed. Not sure how the expected values ended up like that, but as the comments say, "Label.qml exists in the default and fallback styles" and "Button.qml exists in all styles", so it makes no sense to expect that Label.qml or Button.qml is selected from the FallbackStyle when a valid "data" folder is specified. Change-Id: I18dea9fddf8f079e0140b51b567814da0df2802c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickStyle: de-duplicate codeJ-P Nurmi2018-03-121-12/+12
| | | | | | | | | | | | | | Unify reading of QML2_IMPORT_PATH and QT_QUICK_CONTROLS_STYLE_PATH. Change-Id: Icb2a7b6156b5d32235adfe4abec5873256e6fcb5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTheme: don't inherit QPlatformThemeJ-P Nurmi2018-02-272-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QPlatformTheme as a fallback instead of inheriting from it. This way, Qt Quick Controls 2 themes don't mess up the fonts and palettes of Qt Quick Controls 1 and Qt Widgets applications. Note: QQuickTheme::Font and QQuickTheme::Palette enums are copies of the respective enums in QPlatformTheme, for now. This is the simplest first step, but later on, we can have our own set of enums that cover controls, such as Switch, that were previously entirely missing from QPlatformTheme. Task-number: QTBUG-51921 Change-Id: I8efe0ba2d03d65bc12b55b533ba9f2fab5320348 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix fonts and palettes in apps without :/qtquickcontrols2.confJ-P Nurmi2018-02-261-2/+6
| | | | | | | | | | | | | | | | Obviously theme fonts and palettes must be resolved regardless of QT_CONFIG(settings) and whether :/qtquickcontrols2.conf exists. Change-Id: I471af2af291dc4508f2eb3985b90faa6d530f096 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add Dense Material style variant for desktopMitch Curtis2018-02-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current Material style is based on the mobile variant of the design, which is far too large for desktop applications. From https://material.io/guidelines/components/lists.html#lists-usage: "When the mouse and keyboard are the primary input methods, measurements may be condensed to accommodate denser layouts." This patch adds a dense variant of the style where most controls like buttons and delegates are smaller in height and use smaller font sizes. Note that the Material design guidelines seem to distinguish between mobile, desktop and dense measurements, where "dense" seems to be a specialization of desktop. We cannot afford to/do not see sense in maintaining three separate variants, so the dense variant will be the only desktop version of the Material style. [ChangeLog][Material] Added Dense variant of the Material style for use on desktop platforms. Some controls are slightly smaller in height and use smaller font sizes. The variant can be enabled by setting QT_QUICK_CONTROLS_MATERIAL_VARIANT to Dense or setting Variant=Dense in the qtquickcontrols.conf file. Task-number: QTBUG-51109 Change-Id: I11846b7f6e61f7b5dcf3c146b18c220234a73ef2 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Promote QQuick(Proxy)Theme from libQQC2 to libQQT2J-P Nurmi2018-02-156-437/+3
| | | | | | | | | | | | | | | | | | | | QQuickTheme needs to be part of libQtQuickTemplates to be able to provide dark and light palettes (and later, icons). Task-number: QTBUG-63331 Change-Id: If7d3d279a07b6daf6701a1d3cd3686bec1d094b4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Read :/qtquickcontrols2.conf in QQuickStylePluginJ-P Nurmi2018-02-154-112/+122
|/ | | | | | | | | | | | | | | | | QQuickTheme is going to be promoted from libQQC2 to libQQT2 so that it can provide dark and light palettes (and later, icons). The first step is to refactor out the :/qtquickcontrols2.conf reading code, which cannot be in style-agnostic libQQT2. Read the conf file in QQuickStyle Plugin instead. The additional benefit is that we don't need duplicate name() methods for styles and their themes. Even though QQuickStyle Plugin's name handling is case-insensitive, QSetting is case-sensitive. Therefore all QQuickStylePlugin::name() overrides have been updated to use capital first letter. This name is used to lookup the correct section in :/qtquickcontrols2.conf. Task-number: QTBUG-63331 Change-Id: I07b1269d9dbc2c9568e6f22f2da75951fde7b669 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2018-01-181-2/+7
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/Tumbler.qml src/quicktemplates2/qquicktumbler.cpp src/quicktemplates2/qquicktumbler_p.h src/quicktemplates2/qquicktumbler_p_p.h Change-Id: I8d50991183fe3c5b50a49e00f01bcd3049f5346c
| * Make Tumbler compatible with deferred executionMitch Curtis2018-01-171-2/+7
| | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2018-01-109-36/+485
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/BusyIndicator.qml src/imports/controls/CheckBox.qml src/imports/controls/CheckDelegate.qml src/imports/controls/ComboBox.qml src/imports/controls/DelayButton.qml src/imports/controls/Dial.qml src/imports/controls/ItemDelegate.qml src/imports/controls/MenuItem.qml src/imports/controls/RadioButton.qml src/imports/controls/RadioDelegate.qml src/imports/controls/SwipeDelegate.qml src/imports/controls/Switch.qml src/imports/controls/SwitchDelegate.qml src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc src/imports/controls/material/CheckDelegate.qml src/imports/controls/material/ItemDelegate.qml src/imports/controls/material/MenuItem.qml src/imports/controls/material/RadioDelegate.qml src/imports/controls/material/SwipeDelegate.qml src/imports/controls/material/SwitchDelegate.qml src/imports/controls/qquickdefaultbusyindicator.cpp src/imports/controls/qquickdefaultbusyindicator_p.h src/imports/controls/qtquickcontrols2plugin.cpp src/imports/controls/universal/CheckDelegate.qml src/imports/controls/universal/ItemDelegate.qml src/imports/controls/universal/MenuItem.qml src/imports/controls/universal/RadioDelegate.qml src/imports/controls/universal/SwipeDelegate.qml src/imports/controls/universal/SwitchDelegate.qml src/quickcontrols2/quickcontrols2.pri src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickmenu.cpp src/quicktemplates2/qquickpopup_p.h Change-Id: Ib25c8b4a7fe018b7c0ade9b02bfaaa6980118c15
| * Doc: improve Style/FallbackStyle documentationMitch Curtis2018-01-041-0/+4
| | | | | | | | | | | | | | | | | | 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>
| * 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>
| * Default: eliminate internal IDs in DelayButtonJ-P Nurmi2017-12-215-0/+427
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2017-12-153-4/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/quickcontrols2/quickcontrols2.pro src/imports/controls/ComboBox.qml src/quicktemplates2/qquickabstractbutton.cpp src/quicktemplates2/qquickabstractbutton_p.h src/quicktemplates2/qquickapplicationwindow_p.h src/quicktemplates2/qquickcombobox.cpp src/quicktemplates2/qquickcontainer.cpp src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickcontrol_p.h src/quicktemplates2/qquickcontrol_p_p.h src/quicktemplates2/qquicklabel_p.h src/quicktemplates2/qquicklabel_p_p.h src/quicktemplates2/qquickslider_p.h src/quicktemplates2/qquickspinbox.cpp src/quicktemplates2/qquicktextarea_p.h src/quicktemplates2/qquicktextarea_p_p.h src/quicktemplates2/qquicktextfield_p.h src/quicktemplates2/qquicktextfield_p_p.h tests/auto/auto.pro tests/auto/controls/data/tst_combobox.qml Change-Id: I34cdd5a9794e34e0f38f70353f2a2d04dfc11074
| * 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>
| * Fix custom scenegraph item animations when used with QQuickWidgetMitch Curtis2017-12-121-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When used within a QQuickWidget, our custom scenegraph item animations wouldn't update. Gunnar suggested that the cause of this is the fact that we're not calling QQuickWindow::update() anywhere (as would be done for us if we implemented these controls with Animators in QML). To go into more detail, QQuickWidget uses a QQuickRenderControl internally, and the render control's renderRequested() and sceneChanged() signals are both connected to QQuickWidget::triggerUpdate(), so if calling QQuickWindow::update() is enough to kick it into action. QQuickWindow::frameSwapped is not emitted as part of QQuickWidget's render cycle, so that is probably the core of the problem. So instead, of using frameSwapped to drive the animation, we drive it directly from our beforeRendering handler. We also want to ensure that the very first animation triggers a start as well, so we make QQuickAnimatedNode::start() call QQuickWindow::update(). It was also suggested that we use direct connections when connecting to QQuickWindow::beforeRendering and QQuickWindow::frameSwapped, as QQuickWindow has affinity to the GUI thread. So, to make sure that things get called on the right thread at the right time, we change that as well. Task-number: QTBUG-62874 Change-Id: Id233be1b80858ec19eef9312f143adffadababff Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQuickIconLabel: fix alignmentJ-P Nurmi2017-11-151-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | QQuickIconLabel is a wrapper around QQuickText & QQuickImage. While the alignment is mostly handled by layouting the internal QQuickText and QQuickImage instances, it must also propagate the alignment so that the text and image elements themselves also apply the correct content alignment. Task-number: QTBUG-64492 Change-Id: Ieb9d26fce703247bc6e2e61fa38e44c29937d1ad Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Visualize mnemonicsJ-P Nurmi2017-11-025-3/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately this comes a bit late in the 5.10 cycle, but this should be released together with the rest of the mnemonics stuff going out in 5.10, because it affects the value of AbstractButton/Menu(Bar)Item::text. As the removed TODO comments and altered tests indicate, previously the ampersand was blatantly stripped out. It would be worse to change it later once people have already started using mnemonics and rely on the behavior in custom styles. The necessary modifications to QQuickText were added in qtdeclarative commit 65ef4ba. Task-number: QTBUG-61422 Change-Id: Iaa73da8c012e9a6019743cf98f5bdc02527064e5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Optimize CheckBox, Switch, and RadioButtonJ-P Nurmi2017-11-023-0/+119
| | | | | | | | | | | | | | | | | | | | Add an internal CheckLabel helper that simply initializes a few QQuickText properties with defaults that are suitable for CheckBox, Switch, and RadioButton. This gives a 10% boost on desktop in debug mode, and a 5% boost on a TX1 in release mode. Change-Id: I82fead9ca22b6aa74f24924d240c924b2a42a912 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickIconImage: fix crash with image providersJ-P Nurmi2017-10-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | QQuickImageBase::load() cannot call until the component creation is completed, because it requires an associated QML engine. All calls to updateIcon() are guarded with the appropriate isComponentComplete() check, but the sourceSizeChanged() signal was connected directly to updateIcon(). Establish the signal-slot connection at component completion to avoid calling updateIcon() to soon. Task-number: QTBUG-63959 Change-Id: I3c935291796dbae031d2728e1d51c55596a51cd0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickPaddedRectangle: prevent negative width and heightJ-P Nurmi2017-09-281-1/+4
| | | | | | | | | | | | | | | | | | If the padding is larger than the available size, the rectangle node should not be given a negative size, because the node is still rendered and it results to undesired rendering artifacts. Change-Id: I082649badb04fe33dbea2ca2c4efcf0f179f41a8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickColor::blend()J-P Nurmi2017-09-272-0/+15
| | | | | | | | | | Change-Id: I60dd2159e7c5c9bbdbea415ac3fe2e40881dbaba Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Default: make Dial use palettesJ-P Nurmi2017-09-262-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: Now that we have configurable palettes, we cannot assume that the default color of the indicator image matches the default palette color. Therefore we need to make ColorImage aware of the default color to avoid unnecessary expensive colorizing (see f0697c6). An extra QML property assignment of a constant value is much cheaper than colorizing the image. Starting from f0697c6, the indicator color has been defined like this: color: control.visualFocus ? Default.focusColor : undefined This assumes that the image has a default color of #353637 when not focused. With this, qmlbench delegates_dial.qml gives a result of 76 frames. The following options were considered: A) color: visualFocus ? palette.highlight : palette.dark => 71 frames B) color: visualFocus ? palette.highlight : palette.dark !== "#353637" ? palette.dark : "transparent" => 71 frames C) defaultColor: "#353637" color: visualFocus ? palette.highlight : palette.dark => 75 frames The last option was a clear winner. Task-number: QTBUG-63369 Change-Id: Ib8d56724de55b874d1c4ecdf0c09b91cfd2dc3df Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | ColorImage: colorize only if neededJ-P Nurmi2017-08-302-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickColorImageProvider got replaced by QQuickColorImage in 9fc3659. This seems to have introduced a performance regression in several controls that are now colorizing images even when there's no need to. Various indicator images have the correct default color that matches the normal state. They need to be colorized only when gaining focus or being disabled, for example. The improvement in qmlbench results: - CheckBox: 70 => 84 frames - ComboBox: 88 => 92 frames - Dial: 73 => 77 frames - MenuItem: 73 => 84 frames Change-Id: I9155042542f5069cff201a1730b9dd2a62cffd67 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickStyle: fix warning about empty filenameMitch Curtis2017-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 0dee566e98f5ff4f224e596de1c04de4f9685df4 (in qtbase) added a check for empty file names to QFileSystemEngine, and we run into that: Empty filename passed to function The fix is to check for empty file names before calling QFile::exists(). Change-Id: I273ea62f97ddcbf5b1a7952405a67ccb45c7672a Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Add Imagine styleJ-P Nurmi2017-07-311-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The Imagine style is based on image assets. The style comes with a default set of images, but the images can be easily changed by providing a directory with images using a predefined naming convention. [ChangeLog][Controls] Added the Imagine style, which is based on image assets that can be provided using a predefined naming convention. Task-number: QTPM-517 Change-Id: I550d7dac9a9686d60bec15655ac92dea9f36149c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-07-112-44/+71
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/controls/data/tst_scrollindicator.qml Change-Id: I1f5581ae7814c0d4152e4c9b79a30a8af5a3a17b
| * Tumbler: fix regression with currentIndex and currentItemMitch Curtis2017-07-072-44/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2c4b2d48 made Tumbler's wrap property follow its count by default, but did so using updatePolish() to account for the use case where a items are appended to the model in a for loop, as is done in TumblerDatePicker.qml in Tumbler's auto tests. This (appending items one at a time in a for loop) is not a good idea, but it should work. The problem with the solution is that the delay means that the use cases mentioned in the referenced bug report were broken. This patch removes the delay. The recursion guards are necessary due to the complex nature of TumblerView (and its non-standard use of the Qt Quick views), as they prevent a memory leak in QQuickListView::createHighlight() from being introuduced. We now call deleteLater() to ensure we do not interfere with the views' internal operations, and hence we also perform a few extra operations at the same time as insurance (although it appears that simply unparenting the internal view from QQuickTumblerView is enough to get the tests to pass). Task-number: QTBUG-61374 Change-Id: Ifef9e99522ea183b282ac862f346beaed12d0c09 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-06-151-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/ButtonGroup.qml tests/auto/controls/data/tst_container.qml tests/auto/menu/tst_menu.cpp Change-Id: Ie8ee7e4f83f3fda6a09507b060576ebda929a7cd
| * Fix typo in code comment in qquicktumblerview.cppMitch Curtis2017-06-131-1/+1
| | | | | | | | | | Change-Id: Ie12bbad5981af263d5dc8fcbb0e7674b9e823132 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-06-081-3/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/src/qtquickcontrols2-index.qdoc src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc src/quicktemplates2/qquickapplicationwindow.cpp src/quicktemplates2/qquickmenu.cpp src/quicktemplates2/qquickmenu_p.h src/quicktemplates2/qquickpopup.cpp tests/auto/auto.pro Change-Id: I856a022d38abd84763127539f46ef032ddc53c3d
| * Fix QQuickStyle::availableStyles()J-P Nurmi2017-06-071-3/+6
| | | | | | | | | | | | | | | | | | Filter out macOS debug symbol (.dSYM) directories from the list of available styles. Task-number: QTBUG-60973 Change-Id: I5b9c3f4af946d44b1601f32bf7da699c29a86689 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add support for configurable palettesJ-P Nurmi2017-06-022-1/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A style's default palette is specified in qtquickcontrols2.conf in a "Palette" group under the style's section. QSettings supports the following two alternative syntaxes: [Fusion] Palette\Window=#dedede Palette\WindowText=#212121 or [Fusion\Palette] Window=#dedede WindowText=#212121 Change-Id: I01bf44d9e332064e955e95f619de634fcb79f010 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Update configure.json for the Fusion styleJ-P Nurmi2017-05-311-1/+2
| | | | | | | | | | | | | | | | | | | | The sections were added while the Fusion style was under development. Now that the purpose-field becomes shorter since doesn't have to repeat "QQC2", we can make it more descriptive by mentioning also that it's a desktop-oriented style. Change-Id: Iffd4ee56d8f33d5b98a6c7842ed43dcd96991995 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add support for configurable fontsJ-P Nurmi2017-05-313-2/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A style's default font is specified in qtquickcontrols2.conf in a "Font" group under the style's section. QSettings supports the following two alternative syntaxes: [Default] Font\Family=Open Sans Font\PixelSize=20 or [Default\Font] Family=Open Sans PixelSize=20 [ChangeLog][Controls] Added support for specifying the default font for different styles in qtquickcontrols2.conf. Change-Id: I54e1efb79a2913eab35174dbf09b6956fe740e28 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-05-301-2/+4
|\| | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickrangeslider.cpp Change-Id: I7eb990cfdc91173f86552841ba16536b35ea09cf
| * Add sections and update purposes of featuresStephan Binner2017-05-301-2/+4
| | | | | | | | | | | | Change-Id: I5beb6770ef3cea097c4baa8384e25f43190fdd9d Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Say hello to the Fusion styleJ-P Nurmi2017-05-301-1/+8
| | | | | | | | | | | | | | | | [ChangeLog][Controls] Introduced a Fusion style that offers a platform agnostic desktop-oriented look'n'feel. Change-Id: Id1c1baf10f4b3a79e89bcc72f6d170ed0b2cc8b0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickDefaultThemeJ-P Nurmi2017-05-292-2/+12
| | | | | | | | | | | | | | | | | | The Default style will be changed to use palettes, and it will be also possible to define the default fonts and palettes for any style in the qqc2.conf file, so the Default style needs its own proxy theme. Change-Id: I0262f7a1f783daa62ca4afbdf3c8fe29d989ca36 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | quickcontrols2.pro: add missing escapeJ-P Nurmi2017-05-271-1/+1
| | | | | | | | | | Change-Id: I356562c298c63586108fd1c993a818b53f227ff0 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>