1 | /* |
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 2006 Hamish Rodda <rodda@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-only |
6 | */ |
7 | |
8 | #ifndef KTOOLBARSPACERACTION_H |
9 | #define KTOOLBARSPACERACTION_H |
10 | |
11 | #include <QWidgetAction> |
12 | #include <memory> |
13 | |
14 | #include <kwidgetsaddons_export.h> |
15 | |
16 | class QWidget; |
17 | |
18 | /*! |
19 | * \class KToolBarSpacerAction |
20 | * \inmodule KWidgetsAddons |
21 | * |
22 | * \brief An extension to QAction which allows for adding a spacer item into a |
23 | * QToolBar / KToolBar. |
24 | * |
25 | * This is useful if you want to align at the right (or left if RTL) and |
26 | * need something that pushes the element to the end of the tool bar. |
27 | */ |
28 | class KWIDGETSADDONS_EXPORT KToolBarSpacerAction : public QWidgetAction |
29 | { |
30 | Q_OBJECT |
31 | |
32 | public: |
33 | /*! |
34 | * Creates a new toolbar spacer action. |
35 | * |
36 | * \a parent The action's parent object. |
37 | */ |
38 | explicit KToolBarSpacerAction(QObject *parent); |
39 | |
40 | ~KToolBarSpacerAction() override; |
41 | |
42 | QWidget *createWidget(QWidget *parent) override; |
43 | |
44 | private: |
45 | std::unique_ptr<class KToolBarSpacerActionPrivate> const d; |
46 | }; |
47 | |
48 | #endif |
49 | |