File indexing completed on 2024-04-28 15:51:38

0001 /***************************************************************************
0002  *   Copyright (C) 2020 by Simone Gaiarin <simgunz@gmail.com>              *
0003  *                                                                         *
0004  *   This program is free software; you can redistribute it and/or modify  *
0005  *   it under the terms of the GNU General Public License as published by  *
0006  *   the Free Software Foundation; either version 2 of the License, or     *
0007  *   (at your option) any later version.                                   *
0008  ***************************************************************************/
0009 
0010 #ifndef ACTIONBAR_H
0011 #define ACTIONBAR_H
0012 
0013 #include <QWidgetAction>
0014 
0015 class QAction;
0016 class QWidget;
0017 
0018 /**
0019  * @short A widget action to display a set of actions in a toolbar
0020  */
0021 class ActionBar : public QWidgetAction
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit ActionBar(QObject *parent = nullptr);
0027     QWidget *createWidget(QWidget *parent) override;
0028 
0029     void addAction(QAction *action);
0030     void insertAction(int pos, QAction *action);
0031     void removeAction(QAction *action);
0032     void recreateWidgets();
0033 
0034 private:
0035     QList<QAction *> m_actions;
0036 };
0037 
0038 #endif