| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2024 Christoph Cullmann <cullmann@kde.org> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #ifndef KSTYLEMANAGER_H |
| 8 | #define KSTYLEMANAGER_H |
| 9 | |
| 10 | #include <kconfigwidgets_export.h> |
| 11 | |
| 12 | class QAction; |
| 13 | class QObject; |
| 14 | |
| 15 | /*! |
| 16 | * \namespace KStyleManager |
| 17 | * \inmodule KConfigWidgets |
| 18 | * \brief Manager for Qt widget styles. |
| 19 | */ |
| 20 | namespace KStyleManager |
| 21 | { |
| 22 | |
| 23 | /*! |
| 24 | * Enforces the style configured by the user with fallback to the Breeze style. |
| 25 | * |
| 26 | * (following the settings in the application configuration with fallback to kdeglobals) |
| 27 | * |
| 28 | * Must be called after one has constructed the QApplication. |
| 29 | * |
| 30 | * If the application is already using the KDE platform theme, the style will not |
| 31 | * be touched and the platform theme will ensure proper styling. |
| 32 | * |
| 33 | * \since 6.3 |
| 34 | */ |
| 35 | KCONFIGWIDGETS_EXPORT void initStyle(); |
| 36 | |
| 37 | /*! |
| 38 | * Creates an action to configure the current used style. |
| 39 | * |
| 40 | * If the application is running using the KDE platform theme, this will |
| 41 | * just return a disabled and hidden action, else it will provide an action to |
| 42 | * show a menu to select the style to use for this applications. |
| 43 | * |
| 44 | * \since 6.3 |
| 45 | */ |
| 46 | KCONFIGWIDGETS_EXPORT QAction *createConfigureAction(QObject *parent = nullptr); |
| 47 | } |
| 48 | |
| 49 | #endif |
| 50 | |