-rw-r--r-- | libopie/otabwidget.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libopie/otabwidget.cpp b/libopie/otabwidget.cpp index 1f3fbb0..6ef4034 100644 --- a/libopie/otabwidget.cpp +++ b/libopie/otabwidget.cpp @@ -93,9 +93,9 @@ OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPositi { tabBar->setShape( QTabBar::RoundedBelow ); } - tabs.setAutoDelete( TRUE ); + //tabs.setAutoDelete( TRUE ); currentTab= 0x0; } OTabWidget::~OTabWidget() @@ -139,9 +139,9 @@ void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &lab } void OTabWidget::removePage( QWidget *childwidget ) { - if ( childwidget ) + if ( childwidget ) { OTabInfo *tab = tabs.first(); while ( tab && tab->control() != childwidget ) { @@ -161,8 +161,10 @@ void OTabWidget::removePage( QWidget *childwidget ) tabList->removeItem( i ); } widgetStack->removeWidget( childwidget ); tabs.remove( tab ); + delete tab; + currentTab = tabs.current(); setUpLayout(); } } } @@ -248,9 +250,9 @@ void OTabWidget::selectTab( OTabInfo *tab ) if ( tabBarStyle == IconTab ) { if ( currentTab ) { - tabBar->tab( currentTab->id() )->setText( QString::null ); + tabBar->tab( currentTab->id() )->setText( "" ); setUpLayout(); } tabBar->tab( tab->id() )->setText( tab->label() ); currentTab = tab; |