author | llornkcor <llornkcor> | 2002-10-20 15:49:18 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-20 15:49:18 (UTC) |
commit | 1a583682e8a49e65d5c478ab72dffb78d120c850 (patch) (side-by-side diff) | |
tree | f37a6beaad8a2807b71cbf596807d30644798466 /libopie/otabwidget.cpp | |
parent | 18ba3be9ca69c42476e310649e3068d2d5f8a03b (diff) | |
download | opie-1a583682e8a49e65d5c478ab72dffb78d120c850.zip opie-1a583682e8a49e65d5c478ab72dffb78d120c850.tar.gz opie-1a583682e8a49e65d5c478ab72dffb78d120c850.tar.bz2 |
added setCurrentTab and getCurrentTab using id for compatibilty
-rw-r--r-- | libopie/otabwidget.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libopie/otabwidget.cpp b/libopie/otabwidget.cpp index aaf14ce..bed7ef1 100644 --- a/libopie/otabwidget.cpp +++ b/libopie/otabwidget.cpp @@ -138,13 +138,13 @@ void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &lab tabs.append( tabinfo ); selectTab( tabinfo ); } void OTabWidget::removePage( QWidget *childwidget ) { - if ( childwidget ) + if ( childwidget ) { OTabInfo *tab = tabs.first(); while ( tab && tab->control() != childwidget ) { tab = tabs.next(); } @@ -198,12 +198,25 @@ void OTabWidget::setCurrentTab( const QString &tabname ) if ( newtab && newtab->label() == tabname ) { selectTab( newtab ); } } +void OTabWidget::setCurrentTab(int tabindex) { + OTabInfo *newtab = tabs.first(); + while ( newtab && newtab->id() != tabindex ) + { + newtab = tabs.next(); + } + if ( newtab && newtab->id() == tabindex ) + { + selectTab( newtab ); + } +} + + OTabWidget::TabStyle OTabWidget::tabStyle() const { return tabBarStyle; } void OTabWidget::setTabStyle( TabStyle s ) @@ -302,6 +315,15 @@ QSize OTabWidget::sizeHint() const } void OTabWidget::resizeEvent( QResizeEvent * ) { setUpLayout(); } + +int OTabWidget::getCurrentTab() { + if ( currentTab ) + { + return currentTab->id(); + } + return -1; +} + |