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 ktoolbarspaceraction.h KToolBarSpacerAction |
20 | * |
21 | * An extension to QAction which allows for adding a spacer item into a |
22 | * QToolBar / KToolBar. |
23 | * |
24 | * This is useful if you want to align at the right (or left if RTL) and |
25 | * need something that pushes the element to the end of the tool bar. |
26 | * |
27 | * @author Hamish Rodda <rodda@kde.org> |
28 | */ |
29 | class KWIDGETSADDONS_EXPORT KToolBarSpacerAction : public QWidgetAction |
30 | { |
31 | Q_OBJECT |
32 | |
33 | public: |
34 | /** |
35 | * Creates a new toolbar spacer action. |
36 | * |
37 | * @param parent The action's parent object. |
38 | */ |
39 | explicit KToolBarSpacerAction(QObject *parent); |
40 | |
41 | ~KToolBarSpacerAction() override; |
42 | |
43 | /** |
44 | * Reimplemented from QWidgetAction. |
45 | */ |
46 | QWidget *createWidget(QWidget *parent) override; |
47 | |
48 | private: |
49 | std::unique_ptr<class KToolBarSpacerActionPrivate> const d; |
50 | }; |
51 | |
52 | #endif |
53 | |