summaryrefslogtreecommitdiff
path: root/libopie
authorzecke <zecke>2002-10-11 22:32:31 (UTC)
committer zecke <zecke>2002-10-11 22:32:31 (UTC)
commitffa7f45a2100b7c438a437fce2d3a47608bd36e3 (patch) (unidiff)
treeccfa8b0c7490d2a271ff7f5edc19ae8e14e277f1 /libopie
parentc8c961b4106f49f544195733cef17af5f15f6bb8 (diff)
downloadopie-ffa7f45a2100b7c438a437fce2d3a47608bd36e3.zip
opie-ffa7f45a2100b7c438a437fce2d3a47608bd36e3.tar.gz
opie-ffa7f45a2100b7c438a437fce2d3a47608bd36e3.tar.bz2
Fix from drw for his widget. This sounds a bit paradox
Remove Page and Inserting one again crashed... This patch fixes this problem
Diffstat (limited to 'libopie') (more/less context) (show whitespace changes)
-rw-r--r--libopie/otabwidget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie/otabwidget.cpp b/libopie/otabwidget.cpp
index 1f3fbb0..6ef4034 100644
--- a/libopie/otabwidget.cpp
+++ b/libopie/otabwidget.cpp
@@ -91,13 +91,13 @@ OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPositi
91 91
92 if ( tabBarPosition == Bottom ) 92 if ( tabBarPosition == Bottom )
93 { 93 {
94 tabBar->setShape( QTabBar::RoundedBelow ); 94 tabBar->setShape( QTabBar::RoundedBelow );
95 } 95 }
96 96
97 tabs.setAutoDelete( TRUE ); 97 //tabs.setAutoDelete( TRUE );
98 currentTab= 0x0; 98 currentTab= 0x0;
99} 99}
100 100
101OTabWidget::~OTabWidget() 101OTabWidget::~OTabWidget()
102{ 102{
103} 103}
@@ -159,12 +159,14 @@ void OTabWidget::removePage( QWidget *childwidget )
159 if ( tabList->text( i ) == tab->label() ) 159 if ( tabList->text( i ) == tab->label() )
160 { 160 {
161 tabList->removeItem( i ); 161 tabList->removeItem( i );
162 } 162 }
163 widgetStack->removeWidget( childwidget ); 163 widgetStack->removeWidget( childwidget );
164 tabs.remove( tab ); 164 tabs.remove( tab );
165 delete tab;
166 currentTab = tabs.current();
165 setUpLayout(); 167 setUpLayout();
166 } 168 }
167 } 169 }
168} 170}
169 171
170void OTabWidget::setCurrentTab( QWidget *childwidget ) 172void OTabWidget::setCurrentTab( QWidget *childwidget )
@@ -246,13 +248,13 @@ QPixmap OTabWidget::loadSmooth( const QString &name )
246void OTabWidget::selectTab( OTabInfo *tab ) 248void OTabWidget::selectTab( OTabInfo *tab )
247{ 249{
248 if ( tabBarStyle == IconTab ) 250 if ( tabBarStyle == IconTab )
249 { 251 {
250 if ( currentTab ) 252 if ( currentTab )
251 { 253 {
252 tabBar->tab( currentTab->id() )->setText( QString::null ); 254 tabBar->tab( currentTab->id() )->setText( "" );
253 setUpLayout(); 255 setUpLayout();
254 } 256 }
255 tabBar->tab( tab->id() )->setText( tab->label() ); 257 tabBar->tab( tab->id() )->setText( tab->label() );
256 currentTab = tab; 258 currentTab = tab;
257 } 259 }
258 tabBar->setCurrentTab( tab->id() ); 260 tabBar->setCurrentTab( tab->id() );