aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols2/qquickstyle.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Allow specifying a relative style path in qtquickcontrols2.confJ-P Nurmi2016-11-301-0/+29
| | | | | | | | | | | | | | | The style path is resolved relative to the location of config file. Even though qtquickcontrols2.conf is normally located in the root of resources, Quick Designer uses QT_QUICK_CONTROLS_CONF to set a custom location for the preview, where the standard config location is not feasible. This patch extends the config and style lookup further by allowing to specify a relative path to a custom style for the Quick Designer preview. Change-Id: Iad9c459421eefbf7a5bcbedfea59f5f16a1d3a39 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-171-1/+19
|\ | | | | | | | | | | | | Conflicts: tests/auto/controls/data/tst_button.qml Change-Id: I5c97b3c1944e52dba44fd3c7d6d9a255c5e08cf7
| * QQuickStyle: kill the temporary QQmlEngine instanceJ-P Nurmi2016-11-171-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | The temporary QQmlEngine instance is not only slow and ugly, but also causes random crashes in the CI. This change replaces the temporary QQmlEngine instance with a local defaultImportPathList() helper method, which is based on the code in QQmlImportDatabase constructor. Later on, we can switch to QQmlImportDatabase::defaultImportPathList() when it has been made available in dev. Change-Id: I9f8363ba79ce39fb0482e6e44be0b1d1040c76e4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Doc: fallback styleJ-P Nurmi2016-10-261-1/+17
| | | | | | | | | | Change-Id: I03996d592de4b7db29b671fa73ab44036a80fa2f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-251-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/src/qtquickcontrols2-material.qdoc src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc src/imports/controls/material/ComboBox.qml Change-Id: I2a57070f96691cb6bbdaae460fbc60a85be435de
| * Doc: fix typo in QQuickStyle briefMitch Curtis2016-10-251-1/+1
| | | | | | | | | | Change-Id: I629871ac8a077fda900f69d788d612bc3688728f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Let specifying the fallback style for custom stylesJ-P Nurmi2016-10-251-6/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, you can call QQuickStyle::setStyle(":/mycontrols") and QQuickStyle::setFallbackStyle("Material") to select a custom style so that the missing files will fallback to the Material style. Notice that the Material and Universal styles do not contain all files. For example, the non-visual Control.qml, Container.qml are not duplicated. For these, we must fallback to the Default style that is guaranteed to contain them all. [ChangeLog][Controls] Added support for specifying the fallback style for custom styles via :/qtquickcontrols2.conf, QT_QUICK_CONTROLS_FALLBACK_STYLE or QQuickStyle::setFallbackStyle(). Change-Id: I00be1c8c6aaca875ef851c90d018e9b5e2f501b7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix QQuickStyle::name() lookupJ-P Nurmi2016-10-131-0/+2
| | | | | | | | | | | | Change-Id: I428baf8988abf51a032e21c369ca021c2da84257 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix style name casingJ-P Nurmi2016-09-021-21/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QQuickStyle looks up the appropriate folder where the specified style exists, it also fixes up the casing of the style name to match what is on the file system. For example, "material" becomes "Material". Since 54480f3, QtQuickControls2Plugin initializes the default style path so QQuickStyle no longer has to create a temporary QQmlEngine to be able to lookup styles in one of the import paths. It still needs to fixup the casing of the style name to ensure that "-style material" and QT_QUICK_CONTROLS_STYLE=material work. Change-Id: If35b870bb335e024b94fb328a927a5550b51cba1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Init QQuickStyle's base URL to avoid creating temp QQmlEngineJ-P Nurmi2016-08-251-3/+14
|/ | | | | | | | | | | | Initialize the base URL from QtQuickControls2Plugin::registerTypes() to avoid creating an unnecessary temporary instance of QQmlEngine. It was used to list all known import paths, which were scanned for the requested style folder. Now that we pass the base URL, the built-in styles (a name without path to the style) can be looked up straight from the base path. Change-Id: I0d68d4c5bb90a4ab89660b5ce97f6433aeefc1ff Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: add missing \since 5.7 tagsJ-P Nurmi2016-05-251-0/+1
| | | | | Change-Id: Ie4680c5dfadc95278215b688f4fc28577f557933 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* qquickstyle.cpp: add missing qdebug.h includeJ-P Nurmi2016-05-131-0/+1
| | | | | Change-Id: Iafc5f93e188e98201938bf8699faebd0dbcb2c32 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickStyle: fix style name lookup on OSXJ-P Nurmi2016-04-231-26/+8
| | | | | | | Just do a case-insensitive search to keep the code simple. Change-Id: If201a468222ea81064ed08814df28c4add0060a9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Implement case-insensitive style name lookupJ-P Nurmi2016-04-231-3/+53
| | | | | | | | Fixes the issue that "./app -style material" did no longer work, but the case had to match exactly (./app -style Material). Change-Id: I446654110af670c391f8e304ce8008fbd6e9acaa Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Rename env vars (QT_LABS_CONTROLS_XXX -> QT_QUICK_CONTROLS_XXX)J-P Nurmi2016-04-221-1/+1
| | | | | Change-Id: Ie903d3491b03d4ec05dd28462a19ee464331d2a2 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* import Qt.labs.controls 1.0 => QtQuick.Controls 2.0J-P Nurmi2016-04-211-1/+1
| | | | | | | | | Docs, resources, .metainfo and plugins.qmltypes will be updated in follow up commits. Change-Id: I4438c5bfb8802bff0fa15c56431cfd288f179861 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix 'Undocumented parameter 'style'' warning in QQuickStyle docsMitch Curtis2016-04-211-1/+1
| | | | | Change-Id: Id99cb3176d209f1627825859afa11ca20c3ae883 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: add section for C++ classes in overview pageNico Vertriest2016-04-171-1/+1
| | | | | Change-Id: I69a112f05b90e1296ad897da0e3d9b04b3e4af33 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Controls: update license headersJ-P Nurmi2016-04-141-1/+1
| | | | | | | This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. Change-Id: Ib653135662bfd353a73290539995e8e5be211587 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Controls: rename the C++ module to qtquickcontrols2J-P Nurmi2016-04-131-0/+168
Change-Id: I087a39baebc296a340739161874636926adaa56c Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>