2012-02-20 21:47:14 +00:00
|
|
|
/* This file is (c) 2012 Tvangeste <i.4m.l33t@yandex.ru>
|
2011-06-23 14:17:09 +00:00
|
|
|
* 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 );
|
|
|
|
|
2011-07-19 10:03:13 +00:00
|
|
|
private:
|
2011-06-23 14:17:09 +00:00
|
|
|
virtual void tabInserted( int index );
|
|
|
|
virtual void tabRemoved( int index );
|
|
|
|
void updateTabBarVisibility();
|
2012-12-27 13:04:46 +00:00
|
|
|
virtual bool eventFilter( QObject * obj, QEvent * ev );
|
2011-06-23 14:17:09 +00:00
|
|
|
|
|
|
|
bool hideSingleTab;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINTABWIDGET_HH
|