forked from RemnantCloude/FlyMessage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fm_sidebar.h
46 lines (38 loc) · 870 Bytes
/
fm_sidebar.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
#ifndef FM_SIDEBAR_H
#define FM_SIDEBAR_H
#include <QWidget>
#include <QVector>
#include <QPushButton>
namespace Ui {
class FM_SideBar;
}
class FM_SBButton : public QPushButton {
Q_OBJECT
public:
explicit FM_SBButton(QWidget *parent,const QString &str);
~FM_SBButton() {}
};
struct FM_SideItemData {
FM_SideItemData() {}
FM_SideItemData(QString s, void(*f)());
~FM_SideItemData() {}
QString caption;
void (*func)();
};
class FM_SideBar : public QWidget
{
Q_OBJECT
public:
explicit FM_SideBar(QWidget *parent = nullptr);
~FM_SideBar();
void setSideBarList(QVector<FM_SideItemData> &idata);
void setWidgetStyle();
void clearItems();
void doNothing();
private slots:
void on_pushButton_clicked();
private:
Ui::FM_SideBar *ui;
QVector<FM_SBButton*> items;
};
#endif // FM_SIDEBAR_H