summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QTBUG36933_brokenPseudoClassLookup() remove setActiveWindow()Frédéric Lefebvre9 days1-1/+0
| | | | | | | | | | | 2f6fe3a26843ff68c5d3f9af0a2fc3cce6caac22 has made calls to QApplicationPrivate::setActiveWindow() redundant. Remove redundant calls. Task-number: QTBUG-121488 Change-Id: I32991b158685d2aa6a9ced225f97ff9f0e6b13d3 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* task232085_spinBoxLineEditBg() remove setActiveWindow()Frédéric Lefebvre9 days1-1/+0
| | | | | | | | | | | 2f6fe3a26843ff68c5d3f9af0a2fc3cce6caac22 has made calls to QApplicationPrivate::setActiveWindow() redundant. Remove redundant calls. Task-number: QTBUG-121488 Change-Id: I8f941c2188563f72f1ff261a8d68bb0e62ae18fd Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* tst_QStylesheetStyle::complexWidgetFocus() remove setActiveWindow()Frédéric Lefebvre9 days1-1/+0
| | | | | | | | | | | 2f6fe3a26843ff68c5d3f9af0a2fc3cce6caac22 has made calls to QApplicationPrivate::setActiveWindow() redundant. Remove redundant calls. Task-number: QTBUG-121488 Change-Id: I9fc6957376a0e42958e0f4c93025058f9f67bf20 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* tst_QStylesheetStyle::tooltip() remove setActiveWindow()Frédéric Lefebvre9 days1-1/+0
| | | | | | | | | | | 2f6fe3a26843ff68c5d3f9af0a2fc3cce6caac22 has made calls to QApplicationPrivate::setActiveWindow() redundant. Remove redundant calls. Task-number: QTBUG-121488 Change-Id: Icad230fe31f7bf06e2f2af462297227b5f47eb63 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* tst_QStylesheetStyle::hoverColors remove setActiveWindow()Frédéric Lefebvre9 days1-1/+0
| | | | | | | | | | | 2f6fe3a26843ff68c5d3f9af0a2fc3cce6caac22 has made calls to QApplicationPrivate::setActiveWindow() redundant. Remove redundant calls. Task-number: QTBUG-121488 Change-Id: I264c1703a0396356f6e17a3122b71bcb8f1813ad Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* tst_QStylesheet::focusColors() remove setActiveWindow()Frédéric Lefebvre9 days1-1/+0
| | | | | | | | | | | 2f6fe3a26843ff68c5d3f9af0a2fc3cce6caac22 has made calls to QApplicationPrivate::setActiveWindow() redundant. Remove redundant calls. Task-number: QTBUG-121488 Change-Id: Idaca35d27b843c47f4c5f88a5a68c01b3cd8fb37 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Reset palette resolve mask in windows vista styleSanthosh Kumar2023-09-051-11/+54
| | | | | | | | | | | | | | The palette set by windows vista style during polish doesn't allow style- sheet style to override it. This patch reset resolve mask for the palette set by windows vista style and thus it can be overridden. Fixes: QTBUG-115511 Pick-to: 6.6 6.5 Change-Id: Ifcaf441f806cfa0273599b3dce83fdfaec3f5a66 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Rename accent color in QPaletteSanthosh Kumar2023-08-181-3/+3
| | | | | | | | | | Accent color role has been renamed according to name rule of other color roles in QPalette. Fixes: QTBUG-116107 Pick-to: 6.6 Change-Id: I70ac98a1e97afbdc7ea5f8d79f808c307e170712 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QStyleSheetStyle: Default to foreground for unset brushes onlyAxel Spoerl2023-06-091-0/+27
| | | | | | | | | | | | | | | | | | | | If a foreground style has been defined in the style sheet, QStyleSheetStyle populates its brushes for the color roles ButtonText, WindowText, Text, and the widget's foregroundRole with the foreground brush. PlaceholderText is set to the same brush with a modified color. That sets their resolve bits in QStyleSheeetStyle's palette and prevents these color roles from being inherited by the widget's palette - in contrast to all other brushes. This patch makes the brushes mentioned default to the widget's palette if they are set there. It adds a test in tst_QStyleSheetStyle. Fixes: QTBUG-93009 Pick-to: 6.6 6.5 Change-Id: Ie3df9dbd17b96fa72beee90792fc7eca1933cdbe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Implement color role AccentColor in QStyleSheetStyle and QCssParserAxel Spoerl2023-05-221-0/+10
| | | | | | | | | | | | | | | | | The color role AccentColor has been added to QPalette. This patch implements the new color role in QCssParser and subsequently in QStyleSheetStyle. The QBrush variable names used to populate brushes, have been changed into speaking names for better code readability. tst_QCssParser has been adapted accordingly. The test function accentColor() has been added in tst_QStyleSheetStyle. Documentation has been updated. Change-Id: Ib09ddc1b61868f2bb8f70f654e83ea1c35276d30 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-2/+2
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Style sheets: add placeholder text color property for edit widgetsEirik Aavitsland2022-09-291-0/+4
| | | | | | | | | The placeholder text was given its own QPalette color role in Qt 5.12, but there has been no way to specify it from a Qt style sheet. Fixes: QTBUG-93009 Change-Id: If58ca844c19c65b7eee14c6d5730a4ba27640c33 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* StyleSheetStyle: Fix color of placeholder texts in text editsEirik Aavitsland2022-09-271-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | Prior to 5.12, the placeholder text color was hardcoded to be the same as the text color, but with an alpha of 128, i.e. semi-transparent. In 5.12, it instead got its own ColorRole in QPalette. So behavior changed (In some cases in 5.12 and later, consistently from Qt 6): placeholder texts no longer got a "light" (semi-transparent) version of the css-styled color, but just the default gray/semi-transparent black. That problem was reported as QTBUG-89815. However, the fix for that bug did not apply the semi-transparency, but only used the same color as the text. That caused a confusing visual expression, as actual and placeholder text would look the same. This commit fixes that. The problem was made worse since there is no way to specify the placeholder text color from css, i.e. to style it independently. A follow up commit will aim to add that. Fixes: QTBUG-92199 Task-number: QTBUG-93009 Pick-to: 6.4 6.2 5.15 Change-Id: I9e6698d34eba91cbf65c4da07aa5ac6d9f96a9ed Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deprecate QApplication::setActiveWindow() and mark as internalTor Arne Vestbø2022-08-271-6/+8
| | | | | | | | | | | | | | The function is used the internal window activation machinery and should not be called by user code. Many tests still use this function, and should be ported over to QWidget::activateWindow(). For now they are using the private helper in QApplicationPrivate, so that we can progress with the public API deprecation. Change-Id: I29f1575acf9efdcbae4c005ee9b2eb1bb0c8e5b5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove remnants of the old Intel C++ compilerThiago Macieira2022-05-111-1/+1
| | | | | | | | | | | | | We don't support it any more. I don't think it has ever properly compiled Qt 6 (and it's no longer working for me against GCC 12's libstdc++ headers). If you report a bug against it, Intel support's first question is if you can try instead the new Clang/LLVM-based oneAPI C++ compiler. So we support only that one, which identifies itself as Q_CC_CLANG. Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eb57a092c8439e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Stylesheet: Fix tab layout when tab has a font and iconsVolker Hilsheimer2022-02-021-14/+43
| | | | | | | | | | | | | | | | | | | | | | | Amends e3b2b12a912361af309302a4b1fc27c2206322af, which made the style sheet calculate the font-dependent text size, but didn't add the space needed for the close button or a tab icon. QTabBar's layout code already adds the space needed for icons and margins to the size; so instead of overwriting that size, subtract the size needed by the normal font, and then add the size needed for the font form the style rule, considering both vertical and horizontal tab bars. Fix the test case to style only one tab rather than the entire tab bar, otherwise the font is applied to the entire tab bar, and not just to a specific tab, which is the style sheet style code in question. Pick-to: 6.2 6.3 Task-number: QTBUG-6905 Change-Id: Ieed0ba146a32e81229419adecaf41f467cfd5959 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QCSS: Support Qt 5-style integer property selectorsVolker Hilsheimer2022-01-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5 style sheets, objects could be selected by an enum-type property using the integer value of the enum value, e.g QToolButton[popupMode="1"] { ... } In Qt 6, the the new meta type system and QVariant implementation enabled QVariant::toString to return the string representation of the enum value instead for a property containing an enum. Since QStyleSheetStyle's attribute matching is string based, this breaks the Qt 5 style selector, and QCSS code instead needs to use e.g. QToolButton[popupMode=MenuButtonPopup] { ... } While the new syntax is arguably preferable, this is an unintentional change that silently breaks style sheet code (no error or warning at compile- or run-time). To support Qt 5-style selectors, we have to change the StyleSelector interface of the QCssParser API so that we can pass through what type of value the attribute extractor should return; if an integer string "1" is provided, then we need to compare the enum integer value; if the string provided does not represent a number, then we need to compare the name of the enum value. Since the pure virtual attribute() method that needs to be implemented to extract the attribute value of the node is implemented in modules outside qtbase, add a second virtual method that takes the entire QCss::AttributeSelector, which includes the value to match. Extractor implementations can use it to evaluate which type of data to return for an exact match. The default implementation calls the old attribute() method so that existing StyleSelector implementations continue to work. Make the respective change in the QStyleSheetStyleSelector, and simplify the surrounding code. Adjust other StyleSelector implemnentations in qtbase. As a drive-by, remove the superfluous virtual declaration from those overrides. Once submodules are adjusted to override this virtual function instead of the (now no longer pure) virtual attribute() method, that method can be removed. Pick-to: 6.3 6.2 Fixes: QTBUG-99642 Change-Id: I9a2b3498f77bf7cab5e90980b7dab2f621d3d859 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add test case for style sheet selectors for enum propertiesVolker Hilsheimer2022-01-151-0/+38
| | | | | | | | | | | | | | | | | | | In Qt 5, such selectors have to use the integer value of the enum value. Using the enum value name does not work. In Qt 6, such selectors must use the enum value by name, using the integer does not work. It's not clear yet what changed, possible a side effect of the changes and improvements in the meta object system and QVariant in Qt 6. So for now, document the difference in behavior in a test. Pick-to: 6.2 6.3 5.15 Task-number: QTBUG-99642 Change-Id: I96e0280b191b8ca06b16a97ab3ed367e9a8f43a0 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Implement missing support for 'em' and 'ex' lengths in style sheetVolker Hilsheimer2021-08-101-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | The Qt style sheet reference claimed that Length properties can be specified in 'em' or 'ex' units, but that was never implemented. Add the missing implementation. Since the sizes depend on the size of the font of the current element, we cannot convert the units in the CSS parser, but have to do so in the QRenderRule constructor, where we can make a decision about which font to use if the style sheet itself doesn't specify a font. Fall back to the widget font if possible; otherwise it will be the application default font. The implementation translates em into QFontMetrics.height, identical to what is already done in the QCssParser. This is in line with the CSS specification, but contradicts our previous documentation which stated that 'em' means "width of M". Fix the documentation. Fixes: QTBUG-8096 Pick-to: 6.2 Change-Id: I145e2504ae3b19101a0d0dd63653466b6c2cec1d Done-with: Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Support pt units for sizes, as documentedVolker Hilsheimer2021-07-201-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | Declaration::lengthValue only supported 'px' sizes, but one can transform any 'pt' value into 'px' by multiplying with 1.33. Notes: this ignores display DPI, and instead follows the W3C definition of 'pt' and 'px' as absolute lengths [1]. [1] https://www.w3.org/TR/css3-values/#absolute-lengths 1pt = 1/72th of 1 inch 1px = 1/96th of 1 inch so the conversion is px = pt * (72/96). Add unit test that verifies this using QPushButton's icon-sizes property, also with changed font in preparation of adding support for 'em' and 'ex' units in a follow up commit. Task-number: QTBUG-8096 Pick-to: 6.2 Done-with: Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> Change-Id: I58782e7ad0e2ff9d89ed695f8a23b1e584cfed64 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Repolish child widgets when parent style sheet changesVolker Hilsheimer2021-07-051-0/+14
| | | | | | | | | | | | | | | | | | | If a child widget that is affected by the parent's style sheet is polished (because it's been shown explicitly, for instance by a layout), then it must be repolished when the parent's style sheet changes, even if the parent itself has not been polished yet. Since the style sheet is set on the parent widget, we must repolish the parent (which will repolish the entire widget tree), not just the individual children and grand children. Fixes: QTBUG-76945 Task-number: QTBUG-39427 Task-number: QTBUG-18958 Change-Id: I7bca9ee1badc07202fa05dc97f440f4ca6c9517d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Fix recursion crash when calling setStyleSheet with `qproperty-styleSheet`Zhang Yu2021-06-181-0/+18
| | | | | | | | | | | When calling `setStyleSheet` with property `qproperty-styleSheet`, `QStyleSheetStyle::polish` will call`QStyleSheetStyle::setProperties`, and then`QStyleSheetStyle::setProperties` goes on to call `setProperty`.Because there is property `qproperty-styleSheet`, it will update stylesheet by calling QStyleSheetStyle::polish`. This causes the recursive call to crash. Fixes: QTBUG-94448 Pick-to: 5.15 6.2 Change-Id: I79c51192a939b0b62e5b1d0dcc90d38f79e28222 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* QTabBar: take a style sheet's font into account when laying out tabsVolker Hilsheimer2021-05-061-0/+67
| | | | | | | | | | | | | | If a tab has a font assigned to it through a style sheet, then take the font size into account when calculating the contents rectangle. Add a test, which hardcodes the windows style to avoid flaky behavior when e.g. macOS lays tabs out in the center. Fixes: QTBUG-92988 Pick-to: 6.1 Change-Id: Ifb0ac97db7647cc25367972737be8878e50f6040 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Set the PlaceholderText color in the palette from the stylesheet as wellAndy Shaw2021-01-121-0/+16
| | | | | | | | | | The color should be used across the board, so the PlaceholderText color should also be respecting the one passed for Text and so on. Fixes: QTBUG-89815 Pick-to: 6.0 5.15 Change-Id: I2accb3db35488f95a1c8ebacf2316a08ee416fac Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+1
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deprecate and remove uses of AA_DisableHighDpiScalingTor Arne Vestbø2020-08-311-9/+2
| | | | | | Change-Id: Ibadce68775858c524b998aacad310905ba2c2e8e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Rename confusingly named QFont/QPalette::resolve overloadsVolker Hilsheimer2020-08-251-4/+4
| | | | | | | | | | | | | | | Having three methods with the same name doing different things is unnecessarily confusing, so follow the standard naming convention in Qt and call the getter of the resolve mask resolveMask, and the setter setResolveMask. These methods were all documented as internal. The publicly documented resolve() method that merges two fonts and palettes based on the respective masks remains as it is, even though 'merge' would perhaps be a better name. Change-Id: If90b1ad800834baccd1dbc38fc6b861540d6df6e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QList instead of QVector in widgets testsJarek Kobus2020-06-251-3/+3
| | | | | | Task-number: QTBUG-84469 Change-Id: I490fdb237afad2d8a15954fe34d6b549a83fa4aa Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove deprecated QStyleOption::init()Christian Ehrlicher2020-06-211-1/+1
| | | | | | | | Even it was not marked as deprecated the replacement function initFrom() is available since Qt4 times (and init() is deprecated since then) Change-Id: I09a4ebbf66b01fbe7aec67691dc68d2e42d1cd78 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Remove all use of deprecated Q_OS_OSX defineTor Arne Vestbø2020-04-031-1/+1
| | | | | Change-Id: I49c285604694c93d37c9d1c7cd6d3b1509858319 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Widget tests: Skip tests that fail on WaylandJohan Klokkhammer Helsing2019-10-181-0/+33
| | | | | | | | | | | Either by testing for platform name or window activation. After this gets in, we can enable widget tests in the Wayland bot, which hopefully will reduce the number of regressions in the Wayland plugin. Fixes: QTBUG-62188 Change-Id: I71ce8abd6b5891e5b953126b1c35345892585931 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* tst_QStyleSheetStyle: Pass on High DPI screensFriedemann Kleint2019-09-031-24/+46
| | | | | | | | | | | | | | The test requires High DPI scaling to be disabled since it manipulates the factors itself in a test. Turn it off initially and introduce a member variable containing a suitable size depending on the screen to make the test pass on High DPI screens without violating minimum window widths on Windows. Task-number: QTBUG-76493 Change-Id: I7b908940413d6a35a4bee781b4df07a31069bb17 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Brush up tst_QStyleSheetStyleFriedemann Kleint2019-09-031-145/+198
| | | | | | | | | | | | | | | | | | - Fix includes - Fix a widget leak (incorrectly parented QComboBox) and add a check in cleanup() - Add window titles - Introduce nullptr - Replace C-style casts - Use range-based for - Streamline some code - Fix static invocation - Fix class structure, add override - Use initializer lists Task-number: QTBUG-76493 Change-Id: I035ec782fa1241a5a1d775e86b0591d9bd134359 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-04-161-0/+21
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlocale.qdoc tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp Done-with: Edward Welbourne <edward.welbourne@qt.io> Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I88e0757b2d020f0a244714c87844631df4b3fd13
| * QStyleSheetStyle::repolish: only run on direct childrenFrederik Gladhorn2019-04-121-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | When re-parenting, some widgets change their children. For example QLabel, when set to rich text, will not update, until receiving a polish call, at which time getting a list of all children recursively and then trying to call functions on them will crash, since the children change in the middle of this operation. Fixes: QTBUG-69204 Fixes: QTBUG-74667 Change-Id: I95dd83ebeed14c017e22552ddd47658ae8a09353 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-261-2/+2
|\| | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp Change-Id: I4c9679e3a8ebba118fbf4772301ff8fde60455b9
| * Fix resolve() on fonts returned from QWidget::font()Allan Sandfeld Jensen2019-01-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Set the inherited properties as resolved on the font, so non-default values are passed on in contexts that does resolve logic like QPainter. One test is updated as it actually tests what it is supposed to on more configurations. Fixes: QTBUG-39560 Change-Id: Ief668e992ccdc091337a259a4c1306a00e67c73f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-041-1/+2
|\| | | | | | | | | | | | | Conflicts: src/gui/painting/qdrawhelper.cpp Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
| * Fix tst_QStyleSheetStyle crash on uncommon multi-screen setupAllan Sandfeld Jensen2018-11-271-1/+2
| | | | | | | | | | | | | | It would crash if there is no screen at 0,0. Change-Id: Ic84d75b3d8b917fe3696530cbe843e82923ba676 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Qt Style Sheets: add support for hsl(a) colorsChristian Ehrlicher2018-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt stylesheets color property did not support hsl or hsla although CSS 2.1 does support it. Since QColor natively supports this color model only the color parsing needed to be adjusted. This also adds some stricter checks for a valid css color definition and prints a warning about the issue. [ChangeLog][QtGui][CSS] Added support for hsl/hsla colors Fixes: QTBUG-58804 Change-Id: Ief65a36a7e0ed0d705dc1fe5a8658e8d07fe9a13 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | tst_QStyleSheetStyle: use QString() instead of ""Frederik Gladhorn2018-10-171-37/+37
|/ | | | | | Change-Id: I3bb375108b57059c4fb4f10342f532e20e78c152 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* StyleSheetStyle: Load @Nx imagesMorten Johan Sørvig2018-10-041-0/+33
| | | | | | | | | | | | | Perform a @Nx image file lookup when loading pixmaps. Make drawBackgroundImage() handle high-dpi pixmaps, here the layout calculations needs to be in device- independent pixels Fixes: QTBUG-36825 Change-Id: I61e6f53c59f61f3bd88c34a036349e51e8c8ad92 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge branch '5.11' into devEdward Welbourne2018-07-311-0/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakebuiltins.cpp src/plugins/platforms/windows/qwindowstabletsupport.h src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/styles/qstylesheetstyle.cpp tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp Done-With: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I000b0eb3cea2a5c7a99b95732bfdd41507cf916e
| * Reset geometry constraints when removing stylesheetSergio Martins2018-07-171-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | CSS geometry constraints such as "min-height" or "min-width" will set size constraints on the widget. Removing the stylesheet should remove these constraints. Task-Id: QTBUG-69418 Change-Id: I1008e4390281c90112303d72dd7d59a8acddfcd9 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Add attribute to indicate a widget was the target of a style sheetAaron Kennedy2018-05-231-0/+55
|/ | | | | | | | | | | | | | | | Qt already has the widget attribute WA_StyleSheet to which indicates that a widget was subject to a style sheet, but it doesn't indicate that the widget was actually affected by the style sheet. For example, an application style sheet will set the WA_StyleSheet attribute on all widgets, even if it only targets QPushButtons. The WA_StyleSheetTarget new attribute pairs with WA_StyleSheet to give this extra information. [ChangeLog][QtWidgets] Added the Qt::WA_StyleSheetTarget attribute to indicate that a widget was affected by a style sheet. Change-Id: I7cca18ddec8fbb69f294ae2ef990672a5f4f1d83 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* tests/auto/widgets/{effects,styles}: Avoid unconditional qWait()sKari Oikarinen2018-04-251-7/+6
| | | | | | Task-number: QTBUG-63992 Change-Id: I1af537bae705d4627880c5ae50669b1ef72562f2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* testlib: start sharing common helper functionsGatis Paeglis2017-11-041-5/+2
| | | | | | | | | | | | | | ... by moving them in QTestPrivate namespace (qtesthelpers_p.h). This header file is a convenient staging area for helper APIs, eventually some could be moved to public QTest API. This header file utilizes the same pattern as other qtestlib header files - wrapping functions with QT_${LIBNAME}_LIB to automatically enable certain APIs based on what is in the projects dependencies, e.g. QT += widgets. Change-Id: Ic0266429939c1f3788912ad8b84fc6e0d5edd68b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>