Add api to enable and disable sidebar tabs

This commit is contained in:
Jens Bache-Wiig
2010-02-16 15:36:56 +01:00
parent ced28c7090
commit 61ccb1a585
2 changed files with 58 additions and 8 deletions

View File

@@ -48,6 +48,7 @@ namespace Internal {
QIcon icon;
QString text;
QString toolTip;
bool enabled;
};
class FancyTabBar : public QWidget
@@ -70,8 +71,12 @@ public:
QSize sizeHint() const;
QSize minimumSizeHint() const;
void setTabEnabled(int index, bool enable);
bool isTabEnabled(int index) const;
void insertTab(int index, const QIcon &icon, const QString &label) {
FancyTab tab;
tab.enabled = true;
tab.icon = icon;
tab.text = label;
m_tabs.insert(index, tab);
@@ -130,6 +135,9 @@ public:
int currentIndex() const;
QStatusBar *statusBar() const;
void setTabEnabled(int index, bool enable);
bool isTabEnabled(int index) const;
signals:
void currentAboutToShow(int index);
void currentChanged(int index);