diff options
author | dt <qtc-committer@nokia.com> | 2010-03-24 17:33:29 +0100 |
---|---|---|
committer | dt <qtc-committer@nokia.com> | 2010-03-25 17:37:16 +0100 |
commit | 0742932d177081c1b6fc194136ae54e1610e0488 (patch) | |
tree | 228bcba78d28de1e134a733da2930bb0de6cf8c3 /src/plugins/projectexplorer | |
parent | a3f827b1b8e8a043b32a4de7eeb19681dfa41494 (diff) |
Add currentIndex API to DoubleTabWidget
Reviewed-By: con
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r-- | src/plugins/projectexplorer/doubletabwidget.cpp | 15 | ||||
-rw-r--r-- | src/plugins/projectexplorer/doubletabwidget.h | 6 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/doubletabwidget.cpp b/src/plugins/projectexplorer/doubletabwidget.cpp index 10882e94f4..33f9157e0c 100644 --- a/src/plugins/projectexplorer/doubletabwidget.cpp +++ b/src/plugins/projectexplorer/doubletabwidget.cpp @@ -71,6 +71,21 @@ DoubleTabWidget::~DoubleTabWidget() delete ui; } +int DoubleTabWidget::currentIndex() const +{ + return m_currentIndex; +} + +void DoubleTabWidget::setCurrentIndex(int index) +{ + Q_ASSERT(index < m_tabs.size()); + if (index == m_currentIndex) + return; + m_currentIndex = index; + emit currentIndexChanged(m_currentIndex, m_tabs.at(m_currentIndex).currentSubTab); + update(); +} + void DoubleTabWidget::setTitle(const QString &title) { m_title = title; diff --git a/src/plugins/projectexplorer/doubletabwidget.h b/src/plugins/projectexplorer/doubletabwidget.h index 03717a354e..cebe0406a1 100644 --- a/src/plugins/projectexplorer/doubletabwidget.h +++ b/src/plugins/projectexplorer/doubletabwidget.h @@ -12,7 +12,8 @@ namespace Ui { class DoubleTabWidget; } -class DoubleTabWidget : public QWidget { +class DoubleTabWidget : public QWidget +{ Q_OBJECT public: DoubleTabWidget(QWidget *parent = 0); @@ -26,6 +27,9 @@ public: void removeTab(int index); int tabCount() const; + int currentIndex() const; + void setCurrentIndex(int index); + signals: void currentIndexChanged(int index, int subIndex); |