Changeset View
Changeset View
Standalone View
Standalone View
kstyle/widgets/tabbar_p.h
- This file was added.
1 | #ifndef TABBAR_P_H_INCLUDED | ||||
---|---|---|---|---|---|
2 | #define TABBAR_P_H_INCLUDED | ||||
3 | | ||||
4 | #include "breezestyle.h" | ||||
5 | | ||||
6 | namespace BreezePrivate | ||||
7 | { | ||||
8 | // needed to keep track of tabbars when being dragged | ||||
9 | class TabBarData : public QObject | ||||
10 | { | ||||
11 | public: | ||||
12 | //* constructor | ||||
13 | explicit TabBarData(QObject *parent) | ||||
14 | : QObject(parent) | ||||
15 | { | ||||
16 | } | ||||
17 | | ||||
18 | //* assign target tabBar | ||||
19 | void lock(const QWidget *widget) | ||||
20 | { | ||||
21 | _tabBar = widget; | ||||
22 | } | ||||
23 | | ||||
24 | //* true if tabbar is locked | ||||
25 | bool isLocked(const QWidget *widget) const | ||||
26 | { | ||||
27 | return _tabBar && _tabBar.data() == widget; | ||||
28 | } | ||||
29 | | ||||
30 | //* release | ||||
31 | void release() | ||||
32 | { | ||||
33 | _tabBar.clear(); | ||||
34 | } | ||||
35 | | ||||
36 | private: | ||||
37 | //* pointer to target tabBar | ||||
38 | Breeze::WeakPointer<const QWidget> _tabBar; | ||||
39 | }; | ||||
40 | | ||||
41 | } | ||||
42 | #endif // TABBAR_P_H_INCLUDED |