-
Notifications
You must be signed in to change notification settings - Fork 3
/
RibbonButtonGroupWidget.h
54 lines (35 loc) · 1.18 KB
/
RibbonButtonGroupWidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// Created by weiwu on 21-4-30.
//
#ifndef RIBBON_RIBBONBUTTONGROUPWIDGET_H
#define RIBBON_RIBBONBUTTONGROUPWIDGET_H
#include <QtCore/QArgument>
#include <QtWidgets/QAction>
#include <QtWidgets/QtWidgets>
class RibbonButtonGroupWidgetPrivate;
class RibbonButtonGroupWidget : public QFrame {
Q_OBJECT
public:
RibbonButtonGroupWidget(QWidget *parent = Q_NULLPTR);
~RibbonButtonGroupWidget();
//生成并添加一个action
void addAction(QAction *a);
QAction *addAction(const QString &text, const QIcon &icon,
QToolButton::ToolButtonPopupMode popMode = QToolButton::InstantPopup);
void addMenu(QMenu *menu, QToolButton::ToolButtonPopupMode popMode = QToolButton::InstantPopup);
QAction *addSeparator();
QAction *addWidget(QWidget *w);
QSize sizeHint() const;
QSize minimumSizeHint() const ;
signals:
/**
* @brief 参考QToolBar::actionTriggered的信号
* @param action
*/
void actionTriggered(QAction *action);
protected:
virtual void actionEvent(QActionEvent *e);
private:
RibbonButtonGroupWidgetPrivate *m_d;
};
#endif //RIBBON_RIBBONBUTTONGROUPWIDGET_H