aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qquickstyleselector/tst_qquickstyleselector.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactor QQuickStyleSelectorJ-P Nurmi2018-03-131-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QQuickStyleSelector: fix built-in file selectorsJ-P Nurmi2017-05-201-0/+20
| | | | | | | | | | | | | | | | While selecting style files, the standard built-in platform and local file selectors ("+linux", "+macos", "+windows"...) must be prefixed with the standard file selector indicator ("+"). Previously the style selector would not pick up platform-specific style files unless they were supplied without the prefix. [ChangeLog][Controls][Styles] Fixed the style selection mechanism so that now it is possible to organize platform and locale-specific files into sub-directories, such as "+linux", "+macos", and "+windows". Change-Id: Ia44b6f14fd0247943486fd27609147827bda9666 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Let specifying the fallback style for custom stylesJ-P Nurmi2016-10-251-7/+68
| | | | | | | | | | | | | | | | | | 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>
* QQuickStyleSelector: fix relative path handlingJ-P Nurmi2016-04-251-0/+83
This makes it possible to pass a relative path to the style: ./myapp -style relative/path/to/my/style To make the tests pass, includes a fix to avoid double slashes in selected URLs. Change-Id: I1b366eb7793523dd0f1058236661cedaa1216f3d Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>