Fabcoin Core  0.16.2
P2P Digital Currency
tabbarinfo.h
Go to the documentation of this file.
1 #ifndef TABBARINFO_H
2 #define TABBARINFO_H
3 
4 #include <QStackedWidget>
5 #include <QMap>
6 #include <QTabBar>
7 #include <QIcon>
8 
13 class TabBarInfo : public QObject
14 {
15  Q_OBJECT
16 public:
21  explicit TabBarInfo(QStackedWidget *parent);
22 
29  bool addTab(int index, const QString& name);
30 
35  void removeTab(int index);
36 
42  void setTabVisible(int index, bool visible);
43 
49  void attach(QTabBar* tabBar, QIcon* iconCloseTab);
50 
54  void detach();
55 
60  void setCurrent(int index);
61 
65  void clear();
66 
67 public Q_SLOTS:
72  void on_currentChanged(int index);
73 
77  void on_closeButtonClick();
78 
79 private:
83  void update();
84 
85 private:
86  int m_current;
87  QMap<int, QString> m_mapName;
88  QMap<int, bool> m_mapVisible;
89  QMap<int, int> m_mapTabInfo;
90  QStackedWidget* m_stack;
91  QTabBar* m_tabBar;
92  bool m_attached;
94 };
95 
96 #endif // TABBARINFO_H
void on_closeButtonClick()
on_closeButtonClick Slot for close button click
Definition: tabbarinfo.cpp:134
void setTabVisible(int index, bool visible)
setTabVisible Set tab visible
Definition: tabbarinfo.cpp:59
void removeTab(int index)
removeTab Removing tab
Definition: tabbarinfo.cpp:26
TabBarInfo(QStackedWidget *parent)
TabBarInfo Constructor.
Definition: tabbarinfo.cpp:5
void attach(QTabBar *tabBar, QIcon *iconCloseTab)
attach Attack the tab bar
Definition: tabbarinfo.cpp:68
int m_current
Definition: tabbarinfo.h:86
bool addTab(int index, const QString &name)
addTab Add new tab
Definition: tabbarinfo.cpp:14
QIcon * m_iconCloseTab
Definition: tabbarinfo.h:93
void setCurrent(int index)
setCurrent Set current index
Definition: tabbarinfo.cpp:95
QMap< int, int > m_mapTabInfo
Definition: tabbarinfo.h:89
void update()
update Update the GUI
Definition: tabbarinfo.cpp:157
void detach()
detach Detach the tab bar
Definition: tabbarinfo.cpp:80
const char * name
Definition: rest.cpp:36
void clear()
clear Remove all tabs except the first one which is not closable
Definition: tabbarinfo.cpp:101
void on_currentChanged(int index)
on_currentChanged Slot for changing the tab bar index
Definition: tabbarinfo.cpp:121
bool m_attached
Definition: tabbarinfo.h:92
QMap< int, QString > m_mapName
Definition: tabbarinfo.h:87
QMap< int, bool > m_mapVisible
Definition: tabbarinfo.h:88
QStackedWidget * m_stack
Definition: tabbarinfo.h:90
The TabBarInfo class Class for informations about tabs.
Definition: tabbarinfo.h:13
QTabBar * m_tabBar
Definition: tabbarinfo.h:91