aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/font
Commit message (Collapse)AuthorAgeFilesLines
* Tie minor version of all imports to Qt's minor versionMitch Curtis2018-11-0215-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Skip tst_font::font() on macOS 10.12Mitch Curtis2018-10-221-0/+5
| | | | | | | | | It crashes, but I'm unable to debug it with a CI VM because it won't build. Task-number: QTBUG-70063 Change-Id: Ia9c32a145c40cc55ab56dcf3fd52468d7a925f40 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Skip tst_font::systemFont()Mitch Curtis2018-09-261-0/+2
| | | | | | | | | | | The qmlClearTypeRegistrations() call causes a crash and it's not clear why. Until we can fix it, skip it so that other changes can get in. It should be skipped rather than blacklisted as it shouldn't be run at all. Task-number: QTBUG-70063 Change-Id: I1ff47e034f121014370bbf9d65e8ac68769a8d31 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Create and init QQuickTheme from QtQuickControls2PluginJ-P Nurmi2018-05-221-1/+1
| | | | | | | | | | | | | | | Instead of creating and setting the QQuickTheme instance from each style plugin (e.g. QtQuickControls2MaterialStylePlugin), create the QQuickTheme instance in QtQuickControls2Plugin when the style is being resolved, and just pass the instance to be initialized by the style plugin(s). This avoids the problem that QQuickTheme API was virtual, and sub-classes created from plugins would have vtables destroyed before the QQuickTheme was destroyed. Task-number: QTBUG-67062 Task-number: QTBUG-68087 Change-Id: I19e9ced5296b708c2668c30163389cb3da6be7cf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTheme: rename themeFont() and themePalette()J-P Nurmi2018-05-221-1/+1
| | | | | | | We don't have the conflicting virtual getters anymore. Change-Id: Ia20bfa0a0b1aa67c35a23270eb0241018f8e0ada Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTheme: add setters to make getters non-virtualJ-P Nurmi2018-05-221-12/+2
| | | | | | | | | | This allows us to add more themable attributes (on the side of fonts and palettes) after the QQuickTheme API has been made public, because it won't require adding virtuals. Only the resolve() method is virtual. Task-number: QTBUG-67062 Change-Id: I6a5cc8d15aeaa5a9a0fe9b6d2591077f8822daac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Rename QQuickTheme::current to instanceJ-P Nurmi2018-05-161-2/+2
| | | | | | | | Avoid giving a wrong impression that the theme instance could be changed on the fly. Change-Id: Ifb5078422385d2f15da6a416d89cc9d6f46b0f40 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add QQuickTheme::ScopeJ-P Nurmi2018-03-151-53/+55
| | | | | | | | | | | Replace the old enums that were originally copied from QPlatformTheme, including irrelevant entries for DockWidget, MdiSubWindow, MessageBox, with a unified enum that will be matched to cover everything needed for theming fonts and palettes for Qt Quick Controls 2. Task-number: QTBUG-67062 Change-Id: Ia99d092f28c00210c0c7f24d4241eb5a5d9ceb5b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTheme: cleanup the APIJ-P Nurmi2018-03-151-1/+1
| | | | | | Task-number: QTBUG-67062 Change-Id: Id2f821bd41b72f7bce9885295e89c322eb3332f4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTheme: add missing fonts and palettesJ-P Nurmi2018-03-151-3/+3
| | | | | | | | | SpinBox, Switch, and Tumbler were previously not available in QPlatformTheme, but now we have our own enums so we can add them. Task-number: QTBUG-67062 Change-Id: Ie99a49b464fbbd25051181b75d721f537b8e3a68 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devJ-P Nurmi2018-03-011-0/+37
|\ | | | | | | | | | | | | Conflicts: src/quickcontrols2/qquicktheme.cpp Change-Id: I874011d32a379bf982f760c39c46d3a25e2452d6
| * Fix QQuickTheme::font() and palette()J-P Nurmi2018-03-011-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | QQuickTheme: don't inherit QPlatformThemeJ-P Nurmi2018-02-271-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Tests: cleanup QPlatformTheme referencesJ-P Nurmi2018-02-151-52/+51
| | | | | | | | | | Change-Id: I061f99250ea462b002444de33bc0ae0d80dbf4d5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Promote QQuick(Proxy)Theme from libQQC2 to libQQT2J-P Nurmi2018-02-151-1/+1
|/ | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2017-09-112-0/+123
|\ | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquicklabel.cpp src/quicktemplates2/qquicktextarea.cpp src/quicktemplates2/qquicktextfield.cpp Change-Id: Ibbf6bc48972f58fbc6779a87ac9e2434c56c4db8
| * Fix font inheritanceJ-P Nurmi2017-09-112-0/+123
| | | | | | | | | | | | | | | | | | | | In item views, it can happen during incubation that a control doesn't yet have a window associated when the parent item changes. Therefore we must make sure to resolve the font when the window changes. Task-number: QTBUG-63119 Change-Id: I890f70ae6faa232dcc2c094ccec02e76b371d2cb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Bump QtQuick 2.9 imports to 2.10Mitch Curtis2017-09-0614-14/+14
| | | | | | | | | | Change-Id: I274146911cd8a204fcbf439da9259b0a38c8092e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add Imagine styleJ-P Nurmi2017-07-311-3/+5
|/ | | | | | | | | | | | | 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>
* Fix font inheritance for popupsJ-P Nurmi2017-06-0716-0/+1256
1) First of all, Popup's QObject-parent depends on the way the Popup is declared in QML, or what is passed as a parent to createObject() when creating dynamic instances. For example: - Popup becomes a QObject child of of the contentItem: ApplicationWindow { Popup { } } - Popup becomes a QObject child of the window: ApplicationWindow { Item { Popup { } } } - Popup becomes a QObject child of the specified parent: ApplicationWindow { Component { id: component Popup { } } Component.onComplete: component.createObject(overlay) } Since QQuickWindow and QQuickView did not set the QObject-parent of their contentItem and rootObject, respectively, we had troubles finding popup instances, because window->findChildren<QQuickPopup>() and window->contentItem()->findChildren<QQuickPopup>() would produce inconsistent results. This has been fixed in qtdeclarative commit af6655885, so now we can use window->findChildren() reliably. 2) Popups inherit font from the associated window, not the parent item. It was wrong to call resolveFont() in setParentItem(), because the parent item might not change even though the associated window does. The piece of code was moved to setWindow() instead. 3) QQuickPopupItemPrivate::resolveFont() did not propagate the default font at all when the font was resolved before being associated to a window. 4) After the above fixes had been applied, to ensure that popups always inherit fonts and propagate them down to children as appropriate, we got a new test failure in tst_controls::Popup::test_font() indicating that there were extra font change notifiers triggered at creation time. This was fixed by associating "top-level" popups with the window as soon as they are appended to ApplicationWindow's default property, instead of waiting until the popup is complete and then doing a lookup in the parent hierarchy. Task-number: QTBUG-61114 Change-Id: I6185c76d50835cb7a06b03db0a3ac9ddad64bdd3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>