Commit Graph

204 Commits

Author SHA1 Message Date
Santhosh Kumar
4cf92d83c3 Reset palette resolve mask in windows vista style
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>
2023-09-05 10:59:00 +02:00
Santhosh Kumar
90980a54e8 Rename accent color in QPalette
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>
2023-08-18 00:38:38 +02:00
Alexandru Croitor
68cb89c8b2 CMake: Make widgets tests standalone projects
Add the boilerplate standalone test prelude to each test, so that they
can be opened with an IDE without the qt-cmake-standalone-test script,
but directly with qt-cmake or cmake.

Boilerplate was added using the following scripts:
https://git.qt.io/alcroito/cmake_refactor

Manual adjustments were made where the code was inserted in the wrong
location.

Task-number: QTBUG-93020
Change-Id: I3c0d1a63c474969e5eaee5fdbb1bb0229482fc5b
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-07-05 15:09:32 +02:00
Axel Spoerl
c4635c0d58 QStyleSheetStyle: Default to foreground for unset brushes only
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>
2023-06-09 23:42:47 +02:00
Axel Spoerl
980a499ad0 Implement color role AccentColor in QStyleSheetStyle and QCssParser
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>
2023-05-22 14:45:26 +00:00
Friedemann Kleint
97bfacf1e2 tests: Remove remains of qmake conversion from CMakeLists.txt files
Pick-to: 6.5
Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-17 21:56:49 +01:00
Marc Mutz
1c6bf3e09e Port from container::count() and length() to size() - V5
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>
2022-11-03 14:59:24 +01:00
Marc Mutz
aa37e67ef7 Port from qAsConst() to std::as_const()
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>
2022-10-11 23:17:18 +02:00
Eirik Aavitsland
72a3da3d4d Style sheets: add placeholder text color property for edit widgets
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>
2022-09-29 08:20:56 +02:00
Eirik Aavitsland
df0b70eece StyleSheetStyle: Fix color of placeholder texts in text edits
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>
2022-09-27 20:22:02 +02:00
Tor Arne Vestbø
2436e259ce Deprecate QApplication::setActiveWindow() and mark as internal
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>
2022-08-27 20:22:29 +02:00
Lucie Gérard
32df595275 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 23:58:42 +02:00
Lucie Gérard
fb1b20eab3 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-03 17:14:55 +02:00
Alexandru Croitor
4d22405e48 CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers
Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 14:46:53 +02:00
Lucie Gérard
05fc3aef53 Use SPDX license identifiers
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>
2022-05-16 16:37:38 +02:00
Thiago Macieira
20104bb237 Remove remnants of the old Intel C++ compiler
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>
2022-05-11 12:50:08 -07:00
Robert Löhning
0031c5cb79 QStyle: Fix cases when logicalValue is outside range
Change-Id: I410c40425d6677612dbe3a40cbaa1debba998064
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-10 12:39:11 +01:00
Robert Löhning
4b49c2006f QStyle: Fix overflows and crash when converting slider positions
Qt Creator crashes when max is INT_MAX and min is -1, see bugreport.

Change-Id: I441e76c0ff87052083ed3d77e6085b186402e5d8
Fixes: QTBUG-101581
Pick-to: 6.2 6.3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-09 20:38:16 +00:00
Alexey Edelev
fdf5d11ff6 CMake: Add BUILTIN_TESTDATA option to qt_internal_add_test
Multiple tests use qt_internal_add_resource that copies the
functionality that is already implemented inside the
qt_internal_add_test function. Simplify these test by replacing
the qt_internal_add_resource call with the new BUILTIN_TESTDATA
option.

Change-Id: I18475b817d6f87264f0de53817d6c26c5ccab4e2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-02-11 21:54:44 +01:00
Volker Hilsheimer
55433f90af Stylesheet: Fix tab layout when tab has a font and icons
Amends e3b2b12a91, 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>
2022-02-02 07:10:12 +01:00
Volker Hilsheimer
cb27ed30f7 QCSS: Support Qt 5-style integer property selectors
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>
2022-01-15 19:21:57 +01:00
Volker Hilsheimer
b749163bb8 Add test case for style sheet selectors for enum properties
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>
2022-01-15 07:38:15 +01:00
Volker Hilsheimer
6ff07ec23b macOS: make the slider knob big enough for BigSur and Monterey
The slider is very touch friendly from macOS 11 on, and the knob is quite
large. Give it some extra pixels, and adjust the test accordingly.

Pick-to: 6.2
Task-number: QTBUG-98093
Change-Id: Iedf6db1081cdd4013ca29ce760aea1e0361b1123
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-11-15 09:30:25 +01:00
Volker Hilsheimer
33f9591e37 Implement missing support for 'em' and 'ex' lengths in style sheet
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>
2021-08-10 19:43:02 +02:00
Volker Hilsheimer
a1a6e3d21b Support pt units for sizes, as documented
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>
2021-07-20 13:20:23 +02:00
Volker Hilsheimer
c4f1b0f7c4 Repolish child widgets when parent style sheet changes
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>
2021-07-05 17:36:04 +02:00
Zhang Yu
e9cdcc7cb3 Fix recursion crash when calling setStyleSheet with qproperty-styleSheet
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>
2021-06-18 05:34:52 +00:00
Volker Hilsheimer
e3b2b12a91 QTabBar: take a style sheet's font into account when laying out tabs
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>
2021-05-06 20:06:44 +02:00
Andy Shaw
bb00b63dee Set the PlaceholderText color in the palette from the stylesheet as well
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>
2021-01-12 20:24:28 +01:00
Samuli Piippo
19a756047e tst_qstylesheetstyle: blacklist tests for QEMU ARMv7
QEMU ARMv7 uses different font, which doesn't pass the tests.

Task-number: QTQAINFRA-3836
Change-Id: I8454c35d99045adfd28d3bcbbaf791b0a668978f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-07 16:53:43 +02:00
Joerg Bornemann
ad2da2d27a Remove the qmake project files
Remove the qmake project files for most of Qt.

Leave the qmake project files for examples, because we still test those
in the CI to ensure qmake does not regress.

Also leave the qmake project files for utils and other minor parts that
lack CMake project files.

Task-number: QTBUG-88742
Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-07 15:32:28 +01:00
David Skoland
27d96b4789 Replace QtTest headers with QTest
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>
2020-12-22 15:20:30 +01:00
Allan Sandfeld Jensen
564b59d903 Another round of replacing 0 with nullptr
This time based on grepping to also include documentation, tests and
examples previously missed by the automatic tool.

Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-10-07 23:02:47 +02:00
Alexandru Croitor
403213240c CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.
Clean up some stale .prev files that are not needed anymore.
Clean up some project files that are not used anymore.

Task-number: QTBUG-86815
Change-Id: I9947da921f98686023c6bb053dfcc101851276b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-09-23 16:59:06 +02:00
Tor Arne Vestbø
90358f6042 Deprecate and remove uses of AA_DisableHighDpiScaling
Change-Id: Ibadce68775858c524b998aacad310905ba2c2e8e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-08-31 19:14:55 +02:00
Edward Welbourne
7883bf7304 Mark some Qt namespace enum members properly as deprecated
A comment is not good enough, Some of the enum members were even still
in use, or mentioned in documentation.

WA_ContentsPropagated, WA_WState_DND and WA_ForceAcceptDrops have been
deprecated since 4.5.1; and at least the last has been an \omitvalue
in the docs for even longer.  (WA_ShowModal and WA_GroupLeader have
been similarly marked, but are in use, see QTBUG-85816.)

Push back to 5.15.1 in order to be able to remove these at Qt 6.

Pick-to: 5.15.1
Change-Id: I6ea3839767e5f5158b0fed508f65798470191908
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-27 13:05:42 +00:00
Richard Moe Gustavsen
ed813c19fa macOS: rename 'macintosh' style to 'macos'
Change the name/key of the style to 'macos'. Besides the
name 'macintosh' being archaic, we also need this
change to avoid creating 'macintosh' style folders
in QtQuickControls, now that we plan to use QPlatformTheme
also there to resolve the style.

[ChangeLog][Widgets][QStyle] The 'macintosh' style
has been renamed to 'macos'.

Change-Id: I14b8a8b4dbd369e7a7d16b94e4ad27e501e7e8d0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 16:37:43 +02:00
Volker Hilsheimer
b77a3f47c9 Rename confusingly named QFont/QPalette::resolve overloads
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>
2020-08-25 17:59:10 +02:00
Tor Arne Vestbø
f8d1e16da0 Add missing enumeration case in tst_QMacStyle::setSize
Change-Id: Iade36b03c6f8bdaa8feb82ef89744a399f92e21d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-29 14:33:19 +02:00
Tor Arne Vestbø
bd3088ceb3 Fix warnings about unused variables and functions in tests
Change-Id: Ia758a91384083c13fb4d743f500fef7a6629dfd5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-26 18:06:46 +02:00
Alexandru Croitor
db397d1113 CMake: Regenerate subdir test projects
And generate a few more test projects that were missing.

Change-Id: I5df51106549aa5ae09bc3c42360e14b143719547
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-07-09 09:38:39 +02:00
Alexandru Croitor
e9a328bc0e CMake: Regenerate tests with new qt_ prefixed APIs
Use pro2cmake with '--api-version 2' to force regenerate
projects to use the new prefixed qt_foo APIs.

Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-09 09:38:35 +02:00
Jarek Kobus
5accfa1e68 Use QList instead of QVector in widgets tests
Task-number: QTBUG-84469
Change-Id: I490fdb237afad2d8a15954fe34d6b549a83fa4aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 10:13:43 +02:00
Christian Ehrlicher
26a2266304 Remove deprecated QStyleOption::init()
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>
2020-06-21 12:51:24 +02:00
Oliver Wolff
45b0f1be68 Remove winrt
Macros and the await helper function from qfunctions_winrt(_p).h are
needed in other Qt modules which use UWP APIs on desktop windows.

Task-number: QTBUG-84434
Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-06 20:25:49 +02:00
Volker Hilsheimer
90295dcd03 Remove deprecated QStyle enum values
Change-Id: I7eba336017844c06b2976df53d440e167abd7894
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-16 16:53:18 +02:00
Qt Forward Merge Bot
8823bb8d30 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	examples/opengl/doc/src/cube.qdoc
	src/corelib/global/qlibraryinfo.cpp
	src/corelib/text/qbytearray_p.h
	src/corelib/text/qlocale_data_p.h
	src/corelib/time/qhijricalendar_data_p.h
	src/corelib/time/qjalalicalendar_data_p.h
	src/corelib/time/qromancalendar_data_p.h
	src/network/ssl/qsslcertificate.h
	src/widgets/doc/src/graphicsview.qdoc
	src/widgets/widgets/qcombobox.cpp
	src/widgets/widgets/qcombobox.h
	tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
	tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
	tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
	tests/manual/diaglib/debugproxystyle.cpp
	tests/manual/diaglib/qwidgetdump.cpp
	tests/manual/diaglib/qwindowdump.cpp
	tests/manual/diaglib/textdump.cpp
	util/locale_database/cldr2qlocalexml.py
	util/locale_database/qlocalexml.py
	util/locale_database/qlocalexml2cpp.py

Resolution of util/locale_database/ are based on:
https://codereview.qt-project.org/c/qt/qtbase/+/294250
and src/corelib/{text,time}/*_data_p.h were then regenerated by
running those scripts.

Updated CMakeLists.txt in each of
	tests/auto/corelib/serialization/qcborstreamreader/
	tests/auto/corelib/serialization/qcborvalue/
	tests/auto/gui/kernel/
and generated new ones in each of
	tests/auto/gui/kernel/qaddpostroutine/
	tests/auto/gui/kernel/qhighdpiscaling/
	tests/libfuzzer/corelib/text/qregularexpression/optimize/
	tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/
	tests/libfuzzer/gui/text/qtextdocument/sethtml/
	tests/libfuzzer/gui/text/qtextdocument/setmarkdown/
	tests/libfuzzer/gui/text/qtextlayout/beginlayout/
by running util/cmake/pro2cmake.py on their changed .pro files.

Changed target name in
	tests/auto/gui/kernel/qaction/qaction.pro
	tests/auto/gui/kernel/qaction/qactiongroup.pro
	tests/auto/gui/kernel/qshortcut/qshortcut.pro
to ensure unique target names for CMake

Changed tst_QComboBox::currentIndex to not test the
currentIndexChanged(QString), as that one does not exist in Qt 6
anymore.

Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
2020-04-08 20:11:39 +02:00
Tor Arne Vestbø
ab4c22d47d macOS: Remove all use of deprecated Q_OS_OSX define
Change-Id: I49c285604694c93d37c9d1c7cd6d3b1509858319
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-03 13:44:37 +02:00
Tor Arne Vestbø
77885f8402 cmake: Remove APPLE prefix from platform names
None of the other platforms have it.

Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-16 17:57:56 +01:00
Tor Arne Vestbø
db745fdd2d cmake: Fix naming when referring to Apple macOS
Change-Id: Iafb5e448d0d65d42f788464fc600594a5666f9af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-16 17:57:52 +01:00