-
Notifications
You must be signed in to change notification settings - Fork 3
/
ClientTabBar.h
48 lines (33 loc) · 1.04 KB
/
ClientTabBar.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
#ifndef CLIENT_TABBAR_H
#define CLIENT_TABBAR_H
#include <QTabBar>
#include "stdint.h"
class QString;
struct ClientTabData {
ClientTabData(int64_t client_id, int64_t currentProject_id=-1)
: client_id(client_id)
, currentProject_id(currentProject_id) {}
int64_t client_id,
currentProject_id;
};
Q_DECLARE_METATYPE(ClientTabData*)
class ClientTabBar : public QTabBar {
Q_OBJECT
public:
ClientTabBar(QWidget *parent=0);
~ClientTabBar();
/* Eliminate default copy constructor and assignment operator */
ClientTabBar(const ClientTabBar&)= delete;
ClientTabBar& operator=(const ClientTabBar&)= delete;
int addTab(const QString &text, int64_t client_id, int64_t currentProject_id=-1);
ClientTabData* tabData(int ndx);
ClientTabData* currentData();
int64_t tabClient_id(int ndx);
int64_t tabCurrentProject_id(int ndx);
int64_t currentClient_id();
int64_t currentCurrentProject_id();
void removeTab(int ndx);
public slots:
void projectSelected(int64_t client_id, int64_t project_id);
};
#endif