aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qquickstyle
Commit message (Collapse)AuthorAgeFilesLines
* Remove old QQuickPalette implementationVitaly Fanaskov2020-03-181-1/+2
| | | | | | | | | | | | | | The existing implementation was removed in order to reduce massive code duplication and simplify color resolving process. Unit tests were fixed accordingly. See related changes in the qtdeclarative module for the further details. [ChangeLog][General] the palette API is a part of QQuickItem now. Change-Id: Ic94ab4632e626c11d9b26f035e2a8a119c9088ef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Regenerate projectswip/cmakeAlexandru Croitor2020-03-171-9/+8
| | | | | | Change-Id: Ifd6b2289de6465a010f5f2a32789221767b4d5be Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate projects to be in syncAlexandru Croitor2019-11-151-7/+7
| | | | | | Change-Id: I3a57449c9025e22414b8337fcffdeb0f4d769af2 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Convert QtQuickControls2 testsLeander Beernaert2019-10-081-0/+112
| | | | | | | | Initial conversion of QtQuickControls2 tests. Change-Id: I7e09e387ec90f89cc2856c7f7f2cb810b03b7fa3 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix font and palette settings in .conf files not being respectedMitch Curtis2019-02-047-1/+40
| | | | | | | | | | | | | | | | | | | | In 5.11, the font palette read from the qtquickcontrols2.conf file was respected. After some large architectural changes (around the time of 94780538) required to fix a crash, 5.12 stopped respecting these settings. This patch fixes the issue by setting the default font as the System scope font, because that's what QQuickControlPrivate::parentFont() uses as its fallback if no parent item has a font explicitly set. QQuickControlPrivate::parentFont() is used as the starting point for font inheritance/resolution for each control. The same fix is used for palettes. Change-Id: I706a9f109c9959b8ea6b91f842146dbfc876cb2b Fixes: QTBUG-72023 Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Fix incorrect font size in certain styles on WindowsMitch Curtis2019-01-081-0/+5
| | | | | | | | | | | | | | | | | When a style is loaded, QtQuickControls2Plugin::loadStylePlugins() is called. This function uses QPluginLoader to search the style directory for the style plugin. On Windows, the code was looking for the plugin without the debug "d" suffix, causing the style plugin to fail to load for debug builds. This results in the QQuickTheme subclasses not being created, causing controls to be shown with default font sizes. This patch fixes the issue by appending the "d" suffix on Windows. Change-Id: I706dbe39325a104bcd6ce72cb0a8d37025adb055 Fixes: QTBUG-71902 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* tst_QQuickStyle::availableStyles(): Ignore case when checking paths on WindowsFriedemann Kleint2018-12-121-0/+4
| | | | | | | | It is actually possible to get the test to fail in command line environments. Change-Id: I9e37e968bd259e3c7ad4acdb8bf289a64f199891 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Tie minor version of all imports to Qt's minor versionMitch Curtis2018-11-026-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes all Qt Quick Controls 2 imports match the current Qt minor version, which is 12 as of this patch. It also updates all other Qt Quick imports to match. This will also make future version bumps easier as all version numbers in existing code/docs will match. The following commands were used to verify that no old versions remain: for i in `seq 0 11`; do git grep "import QtGraphicalEffects.*1.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick 2.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick.Layouts 1.$i$"; done for i in `seq 0 5`; do git grep "import QtQuick.Controls.*2.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick.Templates 2.$i as T$"; done [ChangeLog] From Qt 5.12 onwards, all import versions in Qt Quick Controls 2 follow the same minor version as Qt's minor version number. For example, the import version for Qt 5.12 is: "import QtQuick.Controls 2.12". Change-Id: I6d87573f20912e041d9c3b7c773cc7bf7b152ec3 Fixes: QTBUG-71095 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix tst_QQuickStyle::qrcInQtQuickControlsStylePathEnvVar() failureMitch Curtis2018-08-202-3/+3
| | | | | | | | | Move DummyStyle into a subdirectory of the "data" directory, because otherwise availableStyles() picks it up and makes us fail. Task-number: QTBUG-70065 Change-Id: Ib69075832b5bcf30c6b960e6a4bcda69f016baf2 Reviewed-by: Liang Qi <liang.qi@qt.io>
* tst_qquickstyle: avoid conflicts with other testsMitch Curtis2018-07-184-17/+31
| | | | | | | | | | | | | qrcStylePaths() uses :/qrcStyles1 and :/qrcStyles2, which conflicts with qrcInQtQuickControlsStylePathEnvVar() in a way that would require us (qrcInQtQuickControlsStylePathEnvVar()) to be aware of tests that ran before us. Avoid this issue by adding more qrc-based styles. Change-Id: I7a5e24f4ea532c19db30d240fe7c077ac2a09a4e Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-07-171-0/+111
|\ | | | | | | | | | | | | | | | | Conflicts: src/quickcontrols2/qquickstyle.cpp src/quicktemplates2/qquickscrollview.cpp tests/auto/qquickstyle/tst_qquickstyle.cpp Change-Id: I9afddf07a956f43cf0445e91b8d1a02f167b6bd5
| * Fix qrc paths in QT_QUICK_CONTROLS_STYLE_PATHMitch Curtis2018-07-164-0/+123
| | | | | | | | | | | | | | | | | | Parse the environment variable manually when the platform's list separator is ':', to avoid issues with qrc paths (which start with ':') not working. Task-number: QTBUG-68219 Change-Id: Ic71d49da5a72a37bc1d2e7b19fbf1de71b3917f3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QQuickStyle::addStylePath(): fix support for qrc pathsMitch Curtis2018-06-254-0/+51
| | | | | | | | | | | | | | | | The code lacked handling for the "qrc" scheme. Task-number: QTBUG-68222 Change-Id: Ia0dfdb748b8bdb40c893375b9de77bd8c05986b6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QQuickStyle: add API for managing style pathsJ-P Nurmi2018-03-161-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QQuickStyle: fix and test QT_QUICK_CONTROLS_CONFJ-P Nurmi2018-02-208-1/+49
| | | | | | | | 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>
* Reset QQuickStyle when the QtQuick.Controls 2 plugin is unloadedJ-P Nurmi2018-02-201-9/+27
| | | | | | | | | Cleanup global static data in QQuickStyle when the controls plugin is unloaded (qmlClearTypeRegistrations()). This ensures that the style is resolved as appropriate when the controls plugin is reloaded. Change-Id: Icebb835e057e6063e4fc0ca035c6836560bc7c14 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix QQuickStyle::availableStyles()J-P Nurmi2017-06-075-1/+21
| | | | | | | | | 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>
* *.pro: osx -> macosJ-P Nurmi2017-04-201-1/+1
| | | | | Change-Id: I29b36eaa417986be24c917bc9c9b1f6441773e3d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-111-1/+1
|\ | | | | | | Change-Id: If797ac58344b20e8de4379343131c097247ba2f2
| * Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | | | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickStyle::availableStyles()J-P Nurmi2016-11-101-0/+8
|/ | | | | | | | | | | | This allows us to introduce platform-specific styles, such as the iOS style, and make them appear correctly in the Gallery example so that we don't have to hard-code the lists separately for different platforms. [ChangeLog][Controls][QQuickStyle] Added availableStyles() method that returns the list of available built-in styles. Change-Id: Ieea88577f402cbc52a844d6777e64c6bd55c5ab9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Let specifying the fallback style for custom stylesJ-P Nurmi2016-10-252-0/+28
| | | | | | | | | | | | | | | | | | 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>
* Bump up all controls and templates imports to version 2.1J-P Nurmi2016-07-082-2/+2
| | | | | | | | | | | | Controls must import templates version 2.1 in order to "inherit" 1-revisioned properties, methods, and signals. So far, this has been done case by case, but it's less error prone and more clear to change them all. For example, if you ever see a source file pasted/linked somewhere, it's easy to identify the version it belongs to. Change-Id: I41609ec1a22bc05ac3e79f953a147ca42d9e0786 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix tests in static buildsJ-P Nurmi2016-07-011-0/+4
| | | | | | | | Sprinkle dummy dependencies.qml files to places where qmlimportscanner needs help detecting the dependencies. Change-Id: I9f638d6f00181a32821c8f3ee9c7f23525a34dcc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Implement case-insensitive style name lookupJ-P Nurmi2016-04-232-0/+79
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>