File indexing completed on 2024-04-28 15:32:16

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2006 Hamish Rodda <rodda@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #ifndef KTOOLBARSPACERACTION_H
0009 #define KTOOLBARSPACERACTION_H
0010 
0011 #include <QWidgetAction>
0012 #include <memory>
0013 
0014 #include <kwidgetsaddons_export.h>
0015 
0016 class QWidget;
0017 
0018 /**
0019  * @class KToolBarSpacerAction ktoolbarspaceraction.h KToolBarSpacerAction
0020  *
0021  * An extension to QAction which allows for adding a spacer item into a
0022  * QToolBar / KToolBar.
0023  *
0024  * This is useful if you want to align at the right (or left if RTL) and
0025  * need something that pushes the element to the end of the tool bar.
0026  *
0027  * @author Hamish Rodda <rodda@kde.org>
0028  */
0029 class KWIDGETSADDONS_EXPORT KToolBarSpacerAction : public QWidgetAction
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034     /**
0035      * Creates a new toolbar spacer action.
0036      *
0037      * @param parent The action's parent object.
0038      */
0039     explicit KToolBarSpacerAction(QObject *parent);
0040 
0041     ~KToolBarSpacerAction() override;
0042 
0043     /**
0044      * Reimplemented from QWidgetAction.
0045      */
0046     QWidget *createWidget(QWidget *parent) override;
0047 
0048 private:
0049     std::unique_ptr<class KToolBarSpacerActionPrivate> const d;
0050 };
0051 
0052 #endif