summaryrefslogtreecommitdiffstats
path: root/src/plugins/platformthemes
Commit message (Collapse)AuthorAgeFilesLines
* QXdgDesktopPortalTheme: watch for color scheme changes on runtimeJan Grulich8 days1-3/+22
| | | | | | | | | | | Subscribe to SettingChanged signal from xdg-desktop-portal to get info when color scheme changes and update it on runtime. Fixes: QTBUG-116197 Pick-to: 6.7 6.6 Change-Id: I7803ea76bc1ac0749d60ee55c1c0d9051dad210a Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QGtk3Theme: Add support for xdg-desktop-portal to get color schemeJan Grulich8 days5-9/+206
| | | | | | | | | | | | | | | | | Use xdg-desktop-portal to get color scheme used by GNOME. Recent GNOME versions use this as primary way to switch between light and dark theme. Make this a preferred way to get color scheme and fallback to previous methods in case xdg-desktop-portal cannot be used. Also update app theme on runtime when color scheme changes, not only when theme is changed. [ChangeLog][Platform Specific Changes][Linux] Add support for xdg-desktop-portal to get color scheme in QGtk3Theme. Fixes: QTBUG-116197 Change-Id: Ib3ffad405bc795ed6f4de4af411efc45721662b9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* QGtk3Theme: Fix QGtk3Interface::fileIconThorbjørn Lindeijer2024-02-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By failing to set the G_FILE_ATTRIBUTE_STANDARD_ICON attribute, the "icon" returned by g_file_info_get_icon was always null and a GLib-GIO-CRITICAL warning was output to the console (at least since glib 2.76.0)[1]. After adding the necessary attribute, the code was crashing, because now a valid icon was returned, however the icon should not be freed[2], which is why I removed the "g_object_unref(icon)". Now it was no longer crashing, but the size of the icons was off. It was passing GTK_ICON_SIZE_BUTTON (4) to gtk_icon_theme_lookup_by_gicon where a size in pixels was expected. I chose 16 because that's the pixel size associated with GTK_ICON_SIZE_BUTTON[3]. Finally I noticed the returned icons had the wrong color. It seems that a GdkPixbuf uses RGBA8888 format[4]. Adding an explicit conversion to ARGB32 made the icons look correct for me. [1] https://gitlab.gnome.org/GNOME/glib/-/commit/ed8e86a7d41a0900d8fa57edc64264d04cf8135b [2] https://docs.gtk.org/gio/method.FileInfo.get_icon.html [3] https://docs.gtk.org/gtk3/enum.IconSize.html#button [4] https://docs.gtk.org/gdk-pixbuf/class.Pixbuf.html#image-data [ChangeLog][Platform Specific Changes][Linux] Fixed file icons provided by QFileIconProvider when using the gtk3 platform theme. Pick-to: 6.5 6.6 6.7 Change-Id: I312ef76ac28bc28435b756d299998485db122906 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QGtk3Theme: define light, midlight, mid, dark and shadow colorsAxel Spoerl2023-10-191-0/+12
| | | | | | | | | | | Define color groups used for shading and in order to render specific inactive texts, e.g. menu item text. Found-by: Piotr Wierciński <piotr.wiercinski@qt.io> Pick-to: 6.6 6.5 Change-Id: I736f5aff1ff5379ce3f78b53e547b0b5f552779f Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
* Fix tooltip palette issue in gtk3 themeSanthosh Kumar2023-10-181-1/+0
| | | | | | | | | | | | The tooltip text doesn't show with right palette when application runs in dark mode using gtk3 theme. This patchset removes explicitly setting ToolTipText palette in gtk3theme. Pick-to: 6.6 6.5 Change-Id: Id90626a377733814c3f32f0bf7e5539097b76dd6 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Fix inactive palette in gtk3 themeSanthosh Kumar2023-10-111-87/+123
| | | | | | | | | | | | | | | | | In gtk3 theme, the inactive color group had been set with incorrect palette or not been set for some cases, which leads to glitch when moving application window. This is because inactive group palettes were applied during window movement and its expected to be set with correct palettes. This patch fixes this issue by setting correct palette for inactive color group. Fixes: QTBUG-112879 Pick-to: 6.6 6.5 Change-Id: I6658843626f322fee0ef99dfafb550956e3e0aee Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Fix disabled button color in Linux (X11/Wayland)Santhosh Kumar2023-10-091-0/+3
| | | | | | | | | | | | | | | | The palette mapping table (as read from gtk widget) maintained in QGtk3Storage misses information of QPalette::Button and QPalette::ButtonText role for QPalette::Disabled color group. This cause disabled button widget to be rendered with incorrect palette (such as in dark color scheme, light palette had been used). This patch fixes this issue by extending palette mapping in QGtk3Storage for disabled color group of button role. Fixes: QTBUG-113486 Pick-to: 6.6.0 6.6 6.5 Change-Id: Ied4b2650c92cc1cda58be69257945991013b276f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* FileChooser portal: Make sure filter.name is not emptyAlbert Astals Cid2023-10-011-0/+3
| | | | | | | | | | Xdg-desktop-portal will reject any OpenFile request if there is an empty filter, so if we can't find the mimetype in the mimedatabase we just use it's "raw name" Pick-to: 6.6 6.5 5.15 Change-Id: I705ae7523445e5c2ec97a42ee334401bc90adb68 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qxdgdesktopportalfiledialog: avoid implicit detachAnton Kudryavtsev2023-09-081-2/+2
| | | | | | | by const methods usage Change-Id: Icbe3e7764ddbb385293c371463d1619d8bd388b6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Mark all of Qt as free of Q_FOREACH, except where it isn'tMarc Mutz2023-08-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | The density of Q_FOREACH uses in this and some other modules is still extremely high, too high for anyone to tackle in a short amount of time. Even if they're not concentrated in just a few TUs, we need to make progress on a global QT_NO_FOREACH default, so grab the nettle and stick to our strategy: Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the #undef QT_NO_FOREACH to indicate that these actually test the macro. Task-number: QTBUG-115839 Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Deprecate Q_ASSUME()Thiago Macieira2023-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | We've known for a long time that this is producing worse code with GCC because of how we implemented in Q_ASSUME_IMPL(). So bite the bullet and actually deprecate the macro, replacing all extant Q_ASSUME() with Q_ASSERT(). The replacement is in C++23. Backporting the support onto Q_ASSUME_IMPL was previously rejected by reviewers. [ChangeLog][Deprecation Notice] The Q_ASSUME() macro is deprecated. This macro has different side-effects depending on the compiler used (GCC compared to Clang and MSVC), and there are certain conditions under which GCC is known to produce worse code than if the macro was absent. To give a hint to the compiler for optimizations, use the C++23 [[assume]] attribute. Change-Id: I80612a7d275c41f1baf0fffd177a3a4ad819fb2d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Mark GTK theme plugin as free of Q_FOREACH, except where it isn'tMarc Mutz2023-08-092-0/+5
| | | | | | | | | | | | | | | | The density of Q_FOREACH uses isn't very high here, but at this time, this author just goes through the code-base and white-lists TUs that still use Q_FOREACH in order to globally enable QT_NO_FOREACH. Mark the whole plugin with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TU by #undef'ing QT_NO_FOREACH locally, at the top of each file. Since the TU is part of a larger executable, this requires the file to be compiled separately, so add it to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). Task-number: QTBUG-115839 Change-Id: If731d02f65131c94afa8beb51679ed2ff7d2cdaa Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix memory leak in QGtk3Interface::themeNameThorbjørn Lindeijer2023-08-032-8/+11
| | | | | | Pick-to: 6.6 6.5 Change-Id: Ib8c90f7ef66c095f0c1fc04f4cc72bf5eea72ddb Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Add support for setting the initial directory in portal file dialogDavid Redondo2023-07-121-13/+12
| | | | | Change-Id: I2bceddb470e7870f19fc616e3dbae73cc057cb66 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QGtk3Theme: Do not default Active WindowText to button foregroundAxel Spoerl2023-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QGtk3Theme uses the GTK button foreground as a default for the WindowText color role. When a GTK3 theme has no specific color for the entry text, this can lead to text on certain assets looking darker and thus disabled. This discontinues usage of the button foreground for the window text. Finding the WindowText color role in QPlatformTheme::SystemPalette now follows the following logic: (1) GTK normal entry text is used if specified. This is the preferred option, copying GTK behavior. (2) If (1) is not specified, the GTK default text color is used, making WindowText equal to Text. (3) If neither (1), nor (2) are specified, the WindowText color role is taken from qt_fusionPalette, where it is also equal to Text. The SystemPalette is used as a default template for all other control or widget speicific palettes. The rules above therefor apply to all screen assets (unless they use a JSON file to specify a their individual WindowText). [ChangeLog][QGtk3Theme][SystemPalette][WindowText] Default to GTK Entry Text / Normal Text / qt_fusionPalette Fixes: QTBUG-114600 Pick-to: 6.6 6.5.2 6.5 Change-Id: I4c96ac7d096526faf4c2feee436753990c6c9f92 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtGui: code tidies: use the 4-arg connect overloadGiuseppe D'Angelo2023-06-281-1/+1
| | | | | | | | The 3-arg connect is error-prone and makes the lifetime of the connection unclear. Change-Id: I99aa3575a7f901ac52f451f9ef51aa903640d097 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QGtk3Interface: Explicitly add monospace font providerAxel Spoerl2023-06-131-1/+2
| | | | | | | | | | | | | | | | In case the current GTK3 theme has no monospace font defined, a monospace font requested by a Qt application can trigger a GTK warning "Theme parsing error: <data>:1:0: Expected a valid selector". The warning is triggered by Qt requesting "{font-family: monospace;}". In this case: => ensure fallback to GTK standard monospace font => request "* {font-family: monospace;}" to avoid the warning Task-number: QTBUG-112896 Pick-to: 6.6 6.5 Change-Id: I24a8da62908af9b153245f53026af60e63a600d7 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* xdgdesktopportal: Fallback to base theme if color scheme is unknownIlya Fedin2023-05-301-0/+2
| | | | | | | | | | | | | This should be better than returning unknown if xdg-desktop-portal is not running or its backend doesn't know color scheme This also matches the pratice of all other QXdgDesktopPortalTheme methods Pick-to: 6.5 Change-Id: I352e091a019bc5b683c3f1dad223e55717888d02 Reviewed-by: Jan Grulich <jgrulich@redhat.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QGtk3Theme: Improve fixed font deliveryAxel Spoerl2023-04-201-2/+21
| | | | | | | | | | | | | | | | | | | | The gtk_fixed widget was used as a reference to obtain a fixed font and HeaderViewFont. This is a mistake, because the gtk_fixed widget is a container for other widgets with fixed geometries and no layouting. This patch makes the default style being used for a fixed font and, as a drive-by, the combo box as a reference for a header view font. A monospace based css provider as explicitly added to the style context, in case a fixed font is requested. The provider is removed afterwards. Task-number: QTBUG-112896 Pick-to: 6.5 Change-Id: I6bfb2ee9e7befdd2102bdcc6e53ced954a024034 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Revert "Gtk3Theme: set XCURSOR_SIZE and XCURSOR_THEME for wayland sessions"Ilya Fedin2023-04-141-14/+0
| | | | | | | | | | | | This reverts commit c0b0c7bebb73e1aa609196ce33668a54bd5e0aef. QPlatformTheme::MouseCursorTheme and MouseCursorSize was added in qtbase a823366f7745c235a752dc01c42276b3fa410937 and qtwayland client supports it in 1c25db5e3f23d48e330170f41b94fbd532932b02. Pick-to: 6.5 Change-Id: Icef2f50d495ac802e3a591d92c222523972b2066 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Rename Qt::Appearance to Qt::ColorSchemeTor Arne Vestbø2023-02-1310-81/+81
| | | | | | | | | | | | Based on discussions in the 6.5 API review, where we concluded that 'appearance' is too general. Instead, we follow the CSS standard and use the term 'color scheme'. Pick-to: 6.5 Change-Id: I8ceaf4138ecadff5ccd962480e8e5beb39b556ec Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Jonas Kvinge <jonas@jkvinge.net> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix build with -no-feature-actionTasuku Suzuki2023-02-121-0/+1
| | | | | | | | | /home/tasuku/io/qt/code/qt/qt5/qtlite/qt5/qtbase/src/plugins/platformthemes/gtk3/qgtk3interface.cpp:640:59: error: return type ‘class QIcon’ is incomplete 640 | QIcon QGtk3Interface::fileIcon(const QFileInfo &fileInfo) const Pick-to: 6.5 Change-Id: I2936a3d7ae4cca200f946103b97659819775a8da Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-libraryTasuku Suzuki2023-02-111-1/+0
| | | | | | | | | qtbase/src/dbus/qdbus_symbols.cpp:18:17: error: ‘Qt’ has not been declared 18 | using namespace Qt::StringLiterals; | ^~ Change-Id: Iaa5f1947bb832706b69e954103761193509644d5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* src: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-103-15/+4
| | | | | | Pick-to: 6.5 Change-Id: Id644d322a602038403bb7f46c532744575fbf6d3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Remove redundant include statement from qgtk3theme.cppAxel Spoerl2023-02-041-1/+0
| | | | | | | | | QSettings was included but not needed. This patch removes the include. Pick-to: 6.5 Change-Id: I9da146312f26f87eb863d6409b90988603cf46d3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Document QGtk3StorageAxel Spoerl2023-01-052-39/+193
| | | | | | | | | Add internal documentation to header and implementation of QGtk3Storage. Pick-to: 6.5 Change-Id: I8e12dad57c2458dea4446cddc8df1ceef59c070c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Document QGtk3InterfaceAxel Spoerl2023-01-052-21/+183
| | | | | | | | | Add internal documentation to header and implementation of QGtk3Interface. Pick-to: 6.5 Change-Id: I3e6e970afa0c2ab26e0ce9efe6285cad1edfdb94 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Change parsing log output in QGtk3Json from qCDebug to qCInfoAxel Spoerl2023-01-031-11/+11
| | | | | | | | | | | | | When a palette mapping is imported from a Json file, parsing errors are logged with qCDebug. This prevents errors from being logged in release builds. This patch replaces qCDebug with qCInfo for Json parsing to make errors visible when the logging category qt.qpa.gtk is activated. Pick-to: 6.5 Change-Id: I3f92ecc3ab51f863f62ccef9f9061902320d3c3c Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Detect appearance by colors unless GTK theme name contains "dark"Axel Spoerl2022-12-283-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | QGtk3Theme detects the appearance property by theme name: If the name contains the keyword "dark", the theme is considered to be dark and otherwise light. This detection logic fails, when the GTK theme is dark without containing the "dark" keyword, e.g. the dark theme "Adapta-Nokto". While QGtk3Theme imports the right colors in that case, it wrongly identifies a light theme. This patch adapts the detection logic: If the theme name contains the "dark" keyword, it is considered a dark theme without further checks. If it doesn't, the current GTK3 theme's default background and foreground colors will be read. If the foreground is lighter than the background, the theme is considered dark. If the background is lighter than the foreground, the theme is considered light. If both colors are identical, the appearance will be Qt::Appearance::Unknown. Task-number: QTBUG-93955 Pick-to: 6.5 Change-Id: I0e0f4870a1397b6a7918331a852284bb1c91199e Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Add Q_UNUSED to avoid compilation errorsTang Haixiang2022-12-221-0/+1
| | | | | | | Variable unused causes compile error or warning, use Q_UNUSED to eliminate it. Change-Id: I6efbc3150cef962fa45ccbbed0dc04794db3cbbe Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Cleanup QGtk3ThemeYuhang Zhao2022-12-211-45/+10
| | | | | | | | | | 1. Remove unused include. 2. Replace unnecessary null checks with asserts. 3. Remove dead code after the cleanup. Change-Id: Ia3c01ae8a1fb491d513071c09f8095c93e35c292 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Fix checkbox and radiobutton background in QGtk3ThemeAxel Spoerl2022-12-161-2/+2
| | | | | | | | | | | | | | | | The background color for radio buttons and checkboxes was not correctly read from the current GTK3 theme in light mode. This has lead to identical colors for indicators and background of radio buttons and checkboxes for certain GTK themes (e.g. Breeze). This patch sets the GTK default foreground color to the base color of palettes for checkboxes and radio buttons. Fixes: QTBUG-109454 Pick-to: 6.5 Change-Id: Ic227029f2d366aa826e7bf1c3870428e3b638638 Reviewed-by: Jonas Kvinge <jonas@jkvinge.net> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* GTK3 theme: simplify codeYuhang Zhao2022-12-161-1/+1
| | | | | | | | | There's no need to first convert to QString and then convert back to QByteArray. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: Idedcf3143f44c640a9259f16e364dfe76ecf4c0d Reviewed-by: Liang Qi <liang.qi@qt.io>
* Re-implement palette, standardPixmap, file icons, fonts in QGtk3ThemeAxel Spoerl2022-12-029-3/+1960
| | | | | | | | | | | | | Read theme colors from GTK3 style context and build platform theme palettes in Qt. React to runtime theme changes. Re-implement methods to retrieve GTK3 styled standardPixmaps, fonts and file icons. Task-number: QTBUG-62510 Change-Id: Ib58d1614850764f2e88cca33883fd6c426b35aee Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Add QPlatformTheme::MouseCursorTheme and MouseCursorSizeLiang Qi2022-11-181-0/+10
| | | | | | | | | | | | | | | | | | | | Also implement in QGenericUnixTheme/QKdeTheme/QGnomeTheme/QGtk3Theme. On Wayland, there is wl_cursor_theme_load() and etc in wayland-cursor.h. On X11/xcb, cursor theme and size are common, either in XCURSOR_THEME and XCURSOR_SIZE envs, or in gsettings for gtk/gnome world. On Windows, cursor theme is part of theme file, see SetWindowTheme in https://learn.microsoft.com/en-gb/windows/win32/api/uxtheme/nf-uxtheme-setwindowtheme . For system settings, for example on Windows 10, Mouse Settings, Additional mouse options, Pointers Tab, Scheme. On macOS, it looks like cursor theme is deprecated. Change-Id: I5821377d966c281fb8330da1f5baa7f0ddf86a9f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Gtk3: fix stack smashing on mismatch between bool and gbooleanThiago Macieira2022-11-111-1/+1
| | | | | | | | | | | | | Glib is written in C and predates C99 (though not really, glib 2.0 was released in 2002), so it defines gboolean as int, a 4-byte type. C++'s bool is a 1-byte type, so this caused a buffer overflow. Problem introduced in 2b77e779ce43386d14bdd2d1109ee182bcd0d047 ("QGtk3Theme: implement appearance function to detect dark themes"). Pick-to: 6.2 6.4 Change-Id: Ieba79baf5ac34264a988fffd172650701fa54da8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Gtk3Theme: set XCURSOR_SIZE and XCURSOR_THEME for wayland sessionsJan Grulich2022-11-081-0/+14
| | | | | | | | | | | | | | | | | | GNOME doesn't set these for Wayland session and without those env variables set users might experience broken cursor with Qt apps as QWayland reads them to setup QWaylandInputDevice. There is no cursor protocol available on Wayland yet, see also https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/58 Qt Wayland QPA plugin still tries to load from those two envs. Fixes: QTBUG-67579 Fixes: QTBUG-87778 Pick-to: 6.4 6.2 5.15 Change-Id: I4e7f6871b56599170b12e796858238b1df6d47d1 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* 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>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace QPlatformTheme::Appearance by Qt:AppearanceAxel Spoerl2022-09-204-14/+14
| | | | | | | | | | | | | With the introduction of Qt:Appearance, its predecessor in QPlatformTheme has become redundant. This patch replaces all occurrences of QPlatformTheme::Appearance with the new enum class. Task-number: QTBUG-106381 Change-Id: I5406f1b7c19f68571f074617c681318c96a6517e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* FileChooser portal: set current_file only when file already existsIlya Fedin2022-09-101-3/+6
| | | | | | | | | | According to xdg-desktop-portal documentation, current_file should be set only when such a file already exists and xdg-desktop-portal-gnome enforces this by being totally broken when current_file is set to a non-existent path Pick-to: 6.4 6.3 6.2 Change-Id: Ie3c80a7c6fd0cf23eea88ddec2149f5904c63394 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QGtk3Dialog: remove the #include for empty mocThiago Macieira2022-09-011-2/+0
| | | | | | | | | | | | | | | | | | This amends 64e6233252117415d6765b6f7a8f4df39490b678. Automoc complains: AutoMoc warning --------------- "SRC:/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp" includes the moc file "qgtk3dialoghelpers.moc", but does not contain a Q_OBJECT, Q_GADGET, Q_GADGET_EXPORT, Q_NAMESPACE, Q_NAMESPACE_EXPORT or Q_ENUM_NS macro. AutoMoc: /home/tjmaciei/src/qt/qt6/qtbase/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp:0:1: note: No relevant classes found. No output generated. Pick-to: 6.4 6.3 6.2 5.15 Change-Id: Ic6547f8247454b47baa8fffd170ea8a8ce0ed06c Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Ilya Fedin <fedin-ilja2010@ya.ru>
* QGtk3Theme: subscribe to theme hint changesIlya Fedin2022-08-271-0/+20
| | | | | | | Pick-to: 6.4 Change-Id: I67a9a0d06e88384c0bb6f5008609bcfbf504705f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-233-3/+3
| | | | | | | 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>
* Move PreselectFirstFileInDirectory theme hint from QGtk3Theme to QGnomeThemeIlya Fedin2022-08-221-2/+0
| | | | | | | | It doesn't use any gtk API, so can live in QGnomeTheme Pick-to: 6.4 Change-Id: Iff0391de6f01a03981f6e45b04fe9824fd2becfc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QGtk3Theme: Support setting dialog parent on WaylandIlya Fedin2022-08-191-2/+21
| | | | | | | | This adds support for setting parent window for GTK dialogs on Wayland using the new API added for portals Change-Id: I29085c926ce4338ff2ad75728d566ec843d3aa5a Reviewed-by: Liang Qi <liang.qi@qt.io>
* Remove unneeded QWindow from QGtk3DialogIlya Fedin2022-08-172-71/+20
| | | | | | | | | | | | | It seems QWindow here is only for making the dialog modal, but QDialog already handles that and this makes two modals block each other depending on the order they created with Task-number: QTBUG-98988 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I6847cfab480395f62eaa0ebf79acf8b024192178 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
* Add license headers to cmake filesLucie Gérard2022-08-033-0/+9
| | | | | | | | | | | | 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>
* Send parent_window handle to desktop portalDavid Redondo2022-07-251-3/+12
| | | | | | | | | | | | | Sending parent_window to the portal allows it/the window manager to better place portal dialogs in respect to the application window, for example on top of it instead of a random position. For this use the focusWindow() (if available) since the API in QDesktopServices does not take a QWindow parameter. The file dialog has an explicit parent that can be used. The introduced virtual is provided as a hook for the wayland platform that already includes a class that inherits from QGenericUnixServices. Change-Id: I5571f08d07e5a4e3ae32efd1f09e2727cec9e7c5 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QGtk3Theme: Respect xcb_xlib config optionIlya Fedin2022-07-072-0/+7
| | | | | | Pick-to: 6.4 6.3 6.2 Change-Id: I4b01a694e8a13a6f009296d8ccfa8f8eb21043e4 Reviewed-by: Liang Qi <liang.qi@qt.io>