summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qpalette.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Allow QPalettePrivate to be used outside of qpalette.cppMitch Curtis2023-10-121-16/+0
| | | | | | | | | | | | | | | | We need access to bitPosition in order to check if a role was set. This fixes the following build error: [...] qwindowstheme.cpp(1150): error C2220: the following warning is treated as an error [...] qwindowstheme.cpp(1150): warning C4506: no definition for inline function 'QPalette::ResolveMask QPalettePrivate::bitPosition(QPalette::ColorGroup,QPalette::ColorRole)' Amends 417878904b39b444632df18f7dd37bcb073c0467. Task-number: QTBUG-116826 Change-Id: I815c7e961198ab93b6ed6132badc2ec693522472 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Update version for QPalette::accent API in documentationSanthosh Kumar2023-09-131-0/+1
| | | | | | | | Follow up patch to 3c391c159ce0e29a9a654edee45bd64bcde6ccd2. Pick-to: 6.6 Change-Id: I23235ae8516a53cf09c00b0daedc054df2f0cfa8 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update documentation for QPalette::accent APISanthosh Kumar2023-09-121-0/+8
| | | | | | | | | | | | The documentation for QPalette::accent had been missed and its updated as part of this patchset. Amends patchset 17c589df94a2245ee92d45839c2cba73566d7310. Fixes: QTBUG-116930 Pick-to: 6.6 Change-Id: Iaa53e15dbecaa3c741e2db013c96b4424be39e91 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Rename accent color in QPaletteSanthosh Kumar2023-08-181-9/+9
| | | | | | | | | | 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>
* Move palette helper functions to QPalettePrivateOliver Eftevaag2023-07-111-50/+11
| | | | | | | | | | | | We want to use the bitPosition function in Qt Quick, in order to be able to unset a bit in the resolve mask for a specific color group and role. This patch, solves this by adding a new qpalette_p.h header, which declares QPalettePrivate, allowing those helper functions to be accessed anywhere internally in the qt framework. Change-Id: Iecb28b48289d6bcabf0936274964a05d3c44efc0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QPalette Fix documentation typoAxel Spoerl2023-06-081-1/+1
| | | | | | | | compliments -> complements Pick-to: 6.6 Change-Id: I5457582299d9cd7d39c8f17ad445cdb796bc8e59 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* Doc: use [since] tag for enum values added in Qt 6.6Volker Hilsheimer2023-05-261-2/+2
| | | | | | | | | Remove the manual "This enum value has been introduced..." text. Doing that only for 6.6 to avoid unnecessary cherry-pick conflicts and general code churn. Change-Id: I89a6fd313582fd0c5d6209608a3740f19f91bd01 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Shoehorn AccentColor into QPalette and keep existing 64bit resolve maskAxel Spoerl2023-05-211-4/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is necessary to add an AccentColor role to QPalette. QPalette currently has 21 color roles and 3 color groups, which require 63 bits to resolve. The resolve mask is implemented with a qint64, which doesn't provide spare bits for another color role. The color role NoRole is used as a default value, marking that a role has not (yet) been defined. The enum value does not represent a valid brush, even though it can theoretically be stored in QPalette's shared data. This patch adds the enum value AccentColor to QPalette::ColorRole, increasing the available color roles to 22. To keep the resolve mask at 63 bits, AccentColor is mapped to NoRole in static constexpr bitPosition. As the enum range would exceed 64 bits without this tweak, 3 additional bits are substracted in the respective static assertion. With NoRole having no bit in the resolve mask, the following adaptions have been implemented: - QPalette::resolve() is adapted to explicitly ignore NoRole. - QPalette::isBrushSet() always returns false for NoRole. - tst_QPalette::setAllPossibleBrushes() to verify the latter - operator== ignores NoRole (documentation updated) AccentColor is added in tst_QPalette::roleValues and enum documentation is adapted. In QPalette's default constructor, the AccentColor brush is defaulting to the Highlight brush, it this is available. Otherwise it is made 30% darker or lighter than the Base brush, depending on dark/light mode heuristics. QPalette's data stram functions have been extended from QDataStream Version Qt_6_6. If earlier versions are de-serialised, the AccentColor defaults to Highlight. An autotest function dataStream() has been added to tst_QPalette. The QDataStream Version Qt_6_6 has been bumped to 21. tst_QDataStream has been adapted to the new version and the new color Role. Change-Id: I98bbf9de95fb83bda921e9614a0db3a3c0ebdf75 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QPalette: always increase serial number when modifyingVolker Hilsheimer2022-11-251-1/+3
| | | | | | | | | | | | | | | | | | | After 109e088c7c5d0c9325966e88d55fd9f7a58f67ea, cache keys were unique for palettes with different private or data instances, but the key did not change when a palette without any shared copies was modified, as that does not create new private data structures. To fix this, always increase the counter for the private data structure, also when not detaching from shared copies. Augment test case with scenario that broke. Pick-to: 6.4 Fixes: QTBUG-108709 Change-Id: I606abfb8b1a03e515e46b10dc840a631eb31d496 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Make sure that palette cache keys are uniqueVolker Hilsheimer2022-10-031-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 1d961491d817490da156769ddce6fce48a0bce4a, palettes are different if they either have different brush data, or a different private. Two privates can share data, but still must generate different cache keys. The cacheKey has so far been composted of the serial number of the Data struct, and a detach number that is incremented when we detach the private. This failed for two reasons: - the implicit copy constructor of the Data class copied the serial number, when it should have incremented it. Fix that by member- initializing the serial number rather than doing it only in the default constructor. The member initialization is also executed for the copy constructor. - the detach_no logic as it was implemented does not guarantee that two copies of the same palette that share data, but have different resolve masks (and thus different privates) have different detach_no values. Use a static serial counter for that number as well. Amend the test case to verfiy that cache keys, and the elements of the cache keys, change when they are expected to. Fixes: QTBUG-106984 Pick-to: 6.2 6.4 Change-Id: I84d7055ce8bfe0d42f1f8e9766f3f1ad610f4ec8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Account for dark system themes in qt_fusionPaletteMitch Curtis2022-08-241-41/+0
| | | | | | | | | | | | | | | | | | | | | | | On Ubuntu (Gnome), the Fusion style didn't account for when a dark theme was set in the system's settings. Neither QGtk3Theme, nor QGnomeTheme (which it derives from) provide a palette() implementation, so they'd fall back to QPlatformTheme's. This default implementation calls QPlatformThemePrivate::initializeSystemPalette(), which uses qt_fusionPalette(). This patch accounts for QPlatformTheme::appearance() in qt_fusionPalette(), adjusting the palette roles accordingly to look correct when run under a dark theme. This also fixes the same issue for the Fusion style in Qt Quick Controls. Fixes: QTBUG-90504 Task-number: QTBUG-99276 Pick-to: 6.4 Change-Id: Id096bf809ef7a63dc440b5a68283e123173e917e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Derive PlaceholderText color from Text color in QPaletteAxel Spoerl2022-08-011-0/+34
| | | | | | | | | | | | | | | | | | | | | Until Qt 5.15, PlaceholderText color was automatically derived from the Text color, dimmed by 50% (set alpha to 128, assuming the text color is fully opaque). This method has been adapted in the static qt_fusionPalette() method. No other static method to populate palettes defines a PlaceholderText color. As a consequence, the Text color is used to render placeholder text characters. This patch adds a static method, that sets missing PlaceholderText colors by deriving them from the corresponding Text color. It takes a dim factor by which the opacity is reduced versus the corresponding Text color. Fixes: QTBUG-105049 Pick-to: 6.4 6.3 6.2 Change-Id: Iebb9d15d56f5d72d7ec68b7a0babdf5825b92665 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QPalette: detach before modifying resolve mask when resolvingVolker Hilsheimer2022-07-151-1/+1
| | | | | | | | | | | | Amends 1d961491d817490da156769ddce6fce48a0bce4a. We modify the resolve mask after making a shared copy of 'other', so we must detach. Call the setter designed for that purpose. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-98762 Change-Id: I4f45223e74764a341378992172787fae73efb8b7 Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Always update QPalette resolve mask, regardless of QBrush changeJiDe Zhang2022-07-081-19/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 56bd1b76d2e81c58a80bf6b5d74219c6b1ab8499 changed the update resolve mask behavior in QPalette to avoid detaching brush data when modifying the resolve mask if the brush value is not changed. But this behavior broke compatibility, it introduced unknown risks, and we cannot ensure that other code in Qt does not depend on the old behavior. We both need to ensure that we don't detach when the value is not changed, and ensure that the resolveMask is always updated regardless of whether the value changes, so we need to split them up and independently share the brush data. QFont will update its corresponding resolveMask even if the value has not changed, so it is better to correct this behavior so that QPalette and QFont are consistent. [ChangeLog][QtGui][QPalette] Always update resolve mask in QPalette::setBrush, even if the value of brush has not changed. Fixes: QTBUG-98762 Pick-to: 6.4 6.3 6.2 Change-Id: Ib845361b30f21c3d78c16ced923c1678b12e05ac Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+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>
* QtGui: includemocsMarc Mutz2022-04-291-0/+2
| | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102886 Change-Id: I1945741794c25679a9d94c0d68c8642e2c823502 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Optimize the QPalette::resolve from the other paletteJiDe Zhang2022-04-281-0/+14
| | | | | | | | | If all the palette's colors are resolved, nothing needs to be done in QPalette::resolve(const QPalette &other). Change-Id: I1573cfa5b5cd1e7eb15f3242aff6ab92e9f8c84b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtGui: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-131-2/+2
| | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I308d86cefcbfd126929b68f9a853d420840c965f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Don't change resolve mask when setting brush doesn't change paletteVolker Hilsheimer2021-12-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 556511f9f39ddc887481e0cd5a877134ceb0da6b, which moved the resolve mask storage into the palette's d-pointer, modifying the resolve mask requires a detach. As of now, we only detached when setting a different brush, but always modified the resolve mask, which broke palettes that shared the d-pointer (likely the global default palette). However, detaching has negative side effects when styles set brushes on temporary palette objects and then use that palette object's cache key to build a cache of pixmaps. As each drawing would detach the palette (even if the palette doesn't change, which is likely), the cache key changes with each detach, and the cache would quickly increase in size. This was addressed in changes d7bcdc3a442b99c2caebd4cfd38de67e14090e05 and 1e75dcf2518e37a7b83d006a4e002f972615b43b. We can either detach and find other ways to address the issues from QTBUG-65475, or we can not change the resolve mask when the brush doesn't change and completely ignore the call. Since QFont ignores the setting of any attribute to a value that is identical to the current value, and since it's possible to force that the resolve-bit is set by calling setBrush twice with different brushes, ignoring the call seems like the better solution. [ChangeLog][QtGui][QPalette] Setting a brush on a palette that is identical to the current brush no longer sets the resolve mask bit for that particular role, so items using the palette will continue to inherit changes from parent items. Fixes: QTBUG-98762 Task-number: QTBUG-65475 Pick-to: 6.2 Change-Id: Ife0f934b6a066858408ef75b7bb7ab61193ceb47 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Stop using mixed enum arithmeticGiuseppe D'Angelo2021-06-131-1/+1
| | | | | | | | | | | It's deprecated. Port some unnamed enumerations (used only to declare constants) to constexpr integers instead. Apply qToUnderlying as needed. Task-number: QTBUG-94059 Change-Id: Ifaa64ece966ce08df40dc71ffcfa7ac038110e0b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-05-261-1/+2
| | | | | | Task-number: QTBUG-93990 Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Update QPalette() documentation to not mention the application paletteTor Arne Vestbø2021-01-041-1/+4
| | | | | | | | | | | | | | | | | | It's an implementation detail that the default constructed palette happens to use the d-pointer of the application palette, and as a result has the same colors as the application palette if requested. The palette has an empty resolve mask, and hence all the colors in the palette are undefined. Users should not rely on QPalette() to represent the application palette when for example overriding a parent palette. Task-number: QTBUG-85226 Pick-to: 6.0 5.15 Change-Id: Ia6747887eef6e9a5f21b2002066608c433260de2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-11/+11
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Fix documentation warningsVolker Hilsheimer2020-10-241-18/+0
| | | | | | | | | Declare hidden friends like qdoc expects them, and other signature fixes Document function parameters Remove documentation for removed APIs. Change-Id: I44c1caeed0d40be04612129d074acc30b75f5259 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Unwrap private QPalette data memberVolker Hilsheimer2020-10-141-7/+7
| | | | | | | | | Following 556511f9f39ddc887481e0cd5a877134ceb0da6b, there is only one data member in addition to the shared QPalettePrivate, so we don't need a data struct anymore. Change-Id: I8d7f33ed042e47464eb5f60a048956f8bf70e0b9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move the QPalette::resolveMask into the privateVolker Hilsheimer2020-08-261-15/+30
| | | | | | | | | | | | | | | | | | | | | | | With 64bits, the mask is exhausted with the 21 colors x 3 color groups we have right now. In order to support accent colors, we need more palette entries. By moving the mask into the d-pointer, we can extend QPalette within the Qt 6 series, without breaking binary compatibility. The resolveMask/setResolveMask methods that take integers are documented as internals, so we can change those signatures after Qt 6.0 as well. As a side effect, setting the resolve mask on a QPalette detaches now. Setting a mask is in most cases done on the result of QPalette::resolve, which is usually detached already. And the QPalette default constructor will have to detach from the global application palette if that palette has any colors set explicitly. Task-number: QTBUG-82925 Change-Id: I1e70f1c4d0dd98303e353b91df5dba2b1fe8ba01 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Rename confusingly named QFont/QPalette::resolve overloadsVolker Hilsheimer2020-08-251-6/+8
| | | | | | | | | | | | | | | 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>
* Remove QVariant(int type, void *data, ...) constructorLars Knoll2020-08-151-1/+1
| | | | | | | | It was marked internal anyway. Use the constructor taking a QMetaType instead. Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-1/+1
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove deprecated members from several QtGui classesVolker Hilsheimer2020-04-271-18/+0
| | | | | | | | | | | | | | Those can be trivially removed as they have direct replacements, or are completely unused. The migration path for QCursor::bitmap and QCursor::mask is QBitmap *pb = c.bitmap(); // up to 5.15, warns in 5.15 QBitmap vb = c.bitmap(Qt::ReturnByValue); // from 5.15, works in 6 QBitmap b = c.bitmap(); // from 6.0 on Change-Id: I3b3acd1c7f09c4c8414e98b3ce11986f1ecd5eda Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-281-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsettings.cpp src/corelib/kernel/qvariant.cpp src/corelib/serialization/qjsoncbor.cpp src/corelib/serialization/qjsonvalue.cpp src/corelib/tools/tools.pri src/gui/image/qimage.cpp src/gui/kernel/qguivariant.cpp src/widgets/kernel/qshortcut.cpp tests/auto/tools/moc/allmocs_baseline_in.json tests/auto/tools/moc/tst_moc.cpp src/opengl/qglframebufferobject.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Leander Beernaert <leander.beernaert@qt.io> Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
| * Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QPalette: fix debug stream operatorVitaly Fanaskov2020-01-031-26/+50
| | | | | | | | | | | | | | | | | | Current implementation takes both color group and color role into account. Code readability is also improved. Fixes: QTBUG-78544 Change-Id: Ibfa925f3e4cb0be89915607eee142926e05000b5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Fix QPalette::isBrushSetVitaly Fanaskov2020-01-021-26/+71
| | | | | | | | | | | | | | | | | | | | | | The previous implementation did not take into account different color groups in resolve mask. It led to some issues when resolving a palette or checking whether a brush is set or not. Task-number: QTBUG-78544 Change-Id: I9b67b2c444eb62c022643022a874dc400005e6ee Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QPalette::setBrush: remove a workaround for PlaceholderTextVitaly Fanaskov2019-12-181-26/+7
|/ | | | | | | | | This partially reverts ebd3a13b807c6af2684b42d3912549caf7ef82aa removing the part that was intended to be removed in Qt 6. Task-number: QTBUG-78544 Change-Id: I4b7eb922c46e44411717f80234fad8ad7dd09aef Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-1/+1
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-1/+1
| | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-141-0/+5
|\ | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-071-0/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoaintegration.mm Done-With: Jörg Bornemann <joerg.bornemann@qt.io> Change-Id: I5a61e161784cc6f947abe370aab8f2971a9cbe78
| | * QDataStream: Fix inconsistent results of iostream with QPalette objectsRyan Chu2019-05-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The value of NColorRoles got changed since 5.11. It introduced one more role called "PlaceholderText" in the ColorRole enumeration. When using QDataStream (5.12) to read QPalette objects from a file written by 5.9 (<5.11), the processing results are inconsistent. Fixes: QTBUG-74885 Change-Id: I14d57f9603a26e5890b4fd57c7e464c5b38eb3f2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | Prefix textstream operators with Qt::Lars Knoll2019-05-021-2/+2
|/ / | | | | | | | | | | | | As the non prefixed variants are deprecated Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Fix and unit test QPalette::resolveAlejandro Exojo2018-12-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The function is setting the brushes correctly in the return value, but without updating the resolve_mask, making it return wrong results in functions like isBrushSet or the debug operator. Added a unit test for the member function, since the class is still mostly untested, and clarified the reference documentation of what the function is supposed to do. Change-Id: Iaa820dc44f095e125f9375cb00da5569986803c6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | QPalette: mark foreground()/background() as deprecatedChristian Ehrlicher2018-12-171-1/+1
|/ | | | | | | | | | QPalette::foreground()/background()/ColorRole::Foreground/Background are deprecated since Qt4 times. Therefore mark them as deprecated so they can be removed in Qt6. Change-Id: I24a47e080241b7f16b8adde1f9f16e29133462a7 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Add a QPalette color role for placeholder textsFilipe Azevedo2018-05-041-2/+41
| | | | | | | This allow to customize easily placeholders in QLineEdit by example. Change-Id: I2bb379164376e1d88b42d6c86c2e5b8df99fbc56 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Make QPalette::setBrush() check before detachingGabriel de Dietrich2018-01-041-15/+17
| | | | | | | | | | | Setting the same brush on the same group and role should not detach nor alter the result of QPalette::isCopyOf(). Task-number: QTBUG-56743 Change-Id: Ic2d0dd757d703b01e8c5d835a8c124b3317653f4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fusion: desaturate the brown shadesJ-P Nurmi2017-04-271-3/+3
| | | | | | | | | | | | | The reference images in tst_qframe had to be updated to match the palette. [ChangeLog][QtWidgets][QFusionStyle] The default palette used by the platform agnostic Fusion style has been desaturated. Previously the window background color, and other colors derived from it, were brown shades. Now these colors are neutral gray that fit better on any desktop. Change-Id: Id6a05e05563b8cbc8f378ee415a64b8f99012b60 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove the Windows XP style from public accessibilityJake Petroules2017-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Later, the Windows XP style will be removed entirely by means of being merged with the Windows Vista style (which inherits from the XP style). There was actually no reason for these styles being separate classes in the first place, because both result in the same appearance for controls on the running version of Windows. Therefore, the windowsxp style merely appears as a "broken" version of the windowsvista style, with only minor differences based on the additional metrics that the vista style provides. The windowsxp style does NOT, and never did, allow users to get a Windows XP style appearance on Windows 7 and above (which is currently Qt's minimum supported platform). Therefore, now that Qt no longer supports Windows XP, the windowsxp style is unusable. [ChangeLog][QtWidgets] The windowsxp style is no longer available as a separate style, because it did not (and cannot) actually provide an XP-style appearance on currently supported Qt platforms. Change-Id: I513d9bce3f247f97cfb28dfee88fe888469e0a6f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-131-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/io/qsettings.cpp src/corelib/itemmodels/qstringlistmodel.cpp tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp Change-Id: I1c6c306ef42c3c0234b19907914b19da706b4a03
| * Doc: Change instances of '(Mac) OS X' to 'macOS'Topi Reinio2016-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change the occurrences where the Mac platform is discussed to use a macro \macos, which expands to 'macOS'. This helps with adapting to future renaming. Update the instructions on mac-specific Q_OS_* macro usage. Add a \target for the old 'Qt for OS X' topic to keep links working for other documentation modules that try to link with the old name. Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>