forked from goldendict/goldendict
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaintabwidget.hh
38 lines (28 loc) · 932 Bytes
/
maintabwidget.hh
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
/* This file is (c) 2012 Tvangeste <[email protected]>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef MAINTABWIDGET_HH
#define MAINTABWIDGET_HH
#include <QTabWidget>
#include <QTabBar>
/// An extension of QTabWidget that allows to better control
/// the tabbar visibility.
class MainTabWidget: public QTabWidget
{
Q_OBJECT
Q_PROPERTY(bool hideSingleTab READ isHideSingleTab WRITE setHideSingleTab)
public:
MainTabWidget( QWidget * parent = 0 );
bool isHideSingleTab() const { return hideSingleTab; }
void setHideSingleTab(bool hide);
signals:
void doubleClicked();
protected:
// virtual void mouseDoubleClickEvent ( QMouseEvent * event );
private:
virtual void tabInserted(int index);
virtual void tabRemoved(int index);
void updateTabBarVisibility();
virtual bool eventFilter( QObject * obj, QEvent * ev );
bool hideSingleTab;
};
#endif // MAINTABWIDGET_HH