summaryrefslogtreecommitdiff
path: root/libopie/otabwidget.cpp
Unidiff
Diffstat (limited to 'libopie/otabwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/otabwidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/otabwidget.cpp b/libopie/otabwidget.cpp
index 99bf067..a1fd2c0 100644
--- a/libopie/otabwidget.cpp
+++ b/libopie/otabwidget.cpp
@@ -1,409 +1,409 @@
1/* 1/*
2                This file is part of the Opie Project 2                This file is part of the Opie Project
3 3
4              Copyright (c) 2002 Dan Williams <williamsdr@acm.org> 4              Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
5 =. 5 =.
6 .=l. 6 .=l.
7           .>+-= 7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can 8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under 9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#include "otabwidget.h" 32#include "otabwidget.h"
33 33
34#include <qpe/config.h> 34#include <qpe/config.h>
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36#include <opie/otabbar.h> 36#include <opie/otabbar.h>
37 37
38#include <qcombobox.h> 38#include <qcombobox.h>
39#include <qwidgetstack.h> 39#include <qwidgetstack.h>
40 40
41OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p ) 41OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p )
42 : QWidget( parent, name ) 42 : QWidget( parent, name )
43{ 43{
44 if ( s == Global ) 44 if ( s == Global )
45 { 45 {
46 Config config( "qpe" ); 46 Config config( "qpe" );
47 config.setGroup( "Appearance" ); 47 config.setGroup( "Appearance" );
48 s = ( TabStyle ) config.readNumEntry( "TabStyle", (int) IconTab ); 48 s = ( TabStyle ) config.readNumEntry( "TabStyle", (int) IconTab );
49 if ( s <= Global || s > IconList) 49 if ( s <= Global || s > IconList)
50 { 50 {
51 s = IconTab; 51 s = IconTab;
52 } 52 }
53 QString pos = config.readEntry( "TabPosition", "Top"); 53 QString pos = config.readEntry( "TabPosition", "Top");
54 if ( pos == "Bottom" ) 54 if ( pos == "Bottom" )
55 { 55 {
56 p = Bottom; 56 p = Bottom;
57 } 57 }
58 else 58 else
59 { 59 {
60 p = Top; 60 p = Top;
61 } 61 }
62 } 62 }
63 63
64 widgetStack = new QWidgetStack( this, "widgetstack" ); 64 widgetStack = new QWidgetStack( this, "widgetstack" );
65 widgetStack->setFrameStyle( QFrame::NoFrame ); 65 widgetStack->setFrameStyle( QFrame::NoFrame );
66 widgetStack->setLineWidth( style().defaultFrameWidth() ); 66 widgetStack->setLineWidth( style().defaultFrameWidth() );
67 67
68 tabBarStack = new QWidgetStack( this, "tabbarstack" ); 68 tabBarStack = new QWidgetStack( this, "tabbarstack" );
69 69
70 tabBar = new OTabBar( tabBarStack, "tabbar" ); 70 tabBar = new OTabBar( tabBarStack, "tabbar" );
71 tabBarStack->addWidget( tabBar, 0 ); 71 tabBarStack->addWidget( tabBar, 0 );
72 connect( tabBar, SIGNAL( selected( int ) ), this, SLOT( slotTabBarSelected( int ) ) ); 72 connect( tabBar, SIGNAL( selected( int ) ), this, SLOT( slotTabBarSelected( int ) ) );
73 73
74 tabList = new QComboBox( false, tabBarStack, "tablist" ); 74 tabList = new QComboBox( false, tabBarStack, "tablist" );
75 tabBarStack->addWidget( tabList, 1 ); 75 tabBarStack->addWidget( tabList, 1 );
76 connect( tabList, SIGNAL( activated( int ) ), this, SLOT( slotTabListSelected( int ) ) ); 76 connect( tabList, SIGNAL( activated( int ) ), this, SLOT( slotTabListSelected( int ) ) );
77 77
78 setTabStyle( s ); 78 setTabStyle( s );
79 setTabPosition( p ); 79 setTabPosition( p );
80 80
81 currentTab= 0x0; 81 currentTab= 0x0;
82} 82}
83 83
84OTabWidget::~OTabWidget() 84OTabWidget::~OTabWidget()
85{ 85{
86} 86}
87 87
88void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &label ) 88void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &label )
89{ 89{
90 QPixmap iconset = loadSmooth( icon ); 90 QPixmap iconset = loadSmooth( icon );
91 91
92 QTab *tab = new QTab(); 92 QTab *tab = new QTab();
93 if ( tabBarStyle == IconTab ) 93 if ( tabBarStyle == IconTab )
94 { 94 {
95 tab->label = QString::null; 95 tab->label = QString::null;
96 } 96 }
97 else 97 else
98 { 98 {
99 tab->label = label; 99 tab->label = label;
100 } 100 }
101 if ( tabBarStyle == IconTab || tabBarStyle == IconList ) 101 if ( tabBarStyle == IconTab || tabBarStyle == IconList )
102 { 102 {
103 tab->iconset = new QIconSet( iconset ); 103 tab->iconset = new QIconSet( iconset );
104 } 104 }
105 int tabid = tabBar->addTab( tab ); 105 int tabid = tabBar->addTab( tab );
106 106
107 if ( tabBarStyle == IconTab || tabBarStyle == IconList ) 107 if ( tabBarStyle == IconTab || tabBarStyle == IconList )
108 { 108 {
109 tabList->insertItem( iconset, label, -1 ); 109 tabList->insertItem( iconset, label, -1 );
110 } 110 }
111 else 111 else
112 { 112 {
113 tabList->insertItem( label ); 113 tabList->insertItem( label );
114 } 114 }
115 115
116 widgetStack->addWidget( child, tabid ); 116 widgetStack->addWidget( child, tabid );
117 widgetStack->raiseWidget( child ); 117 widgetStack->raiseWidget( child );
118 widgetStack->setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); 118 widgetStack->setFrameStyle( QFrame::StyledPanel | QFrame::Raised );
119 119
120 OTabInfo *tabinfo = new OTabInfo( tabid, child, icon, label ); 120 OTabInfo *tabinfo = new OTabInfo( tabid, child, icon, label );
121 tabs.append( tabinfo ); 121 tabs.append( tabinfo );
122 selectTab( tabinfo ); 122 selectTab( tabinfo );
123} 123}
124 124
125void OTabWidget::removePage( QWidget *childwidget ) 125void OTabWidget::removePage( QWidget *childwidget )
126{ 126{
127 if ( childwidget ) 127 if ( childwidget )
128 { 128 {
129 OTabInfo *tab = tabs.first(); 129 OTabInfo *tab = tabs.first();
130 while ( tab && tab->control() != childwidget ) 130 while ( tab && tab->control() != childwidget )
131 { 131 {
132 tab = tabs.next(); 132 tab = tabs.next();
133 } 133 }
134 if ( tab && tab->control() == childwidget ) 134 if ( tab && tab->control() == childwidget )
135 { 135 {
136 tabBar->setTabEnabled( tab->id(), FALSE ); 136 tabBar->setTabEnabled( tab->id(), FALSE );
137 tabBar->removeTab( tabBar->tab( tab->id() ) ); 137 tabBar->removeTab( tabBar->tab( tab->id() ) );
138 int i = 0; 138 int i = 0;
139 while ( i < tabList->count() && tabList->text( i ) != tab->label() ) 139 while ( i < tabList->count() && tabList->text( i ) != tab->label() )
140 { 140 {
141 i++; 141 i++;
142 } 142 }
143 if ( tabList->text( i ) == tab->label() ) 143 if ( tabList->text( i ) == tab->label() )
144 { 144 {
145 tabList->removeItem( i ); 145 tabList->removeItem( i );
146 } 146 }
147 widgetStack->removeWidget( childwidget ); 147 widgetStack->removeWidget( childwidget );
148 tabs.remove( tab ); 148 tabs.remove( tab );
149 delete tab; 149 delete tab;
150 currentTab = tabs.current(); 150 currentTab = tabs.current();
151 if ( !currentTab ) 151 if ( !currentTab )
152 { 152 {
153 widgetStack->setFrameStyle( QFrame::NoFrame ); 153 widgetStack->setFrameStyle( QFrame::NoFrame );
154 } 154 }
155 155
156 setUpLayout(); 156 setUpLayout();
157 } 157 }
158 } 158 }
159} 159}
160 160
161void OTabWidget::changeTab( QWidget *widget, const QString &iconset, const QString &label) 161void OTabWidget::changeTab( QWidget *widget, const QString &iconset, const QString &label)
162{ 162{
163 OTabInfo *currtab = tabs.first(); 163 OTabInfo *currtab = tabs.first();
164 while ( currtab && currtab->control() != widget ) 164 while ( currtab && currtab->control() != widget )
165 { 165 {
166 currtab = tabs.next(); 166 currtab = tabs.next();
167 } 167 }
168 if ( currtab && currtab->control() == widget ) 168 if ( currtab && currtab->control() == widget )
169 { 169 {
170 QTab *tab = tabBar->tab( currtab->id() ); 170 QTab *tab = tabBar->tab( currtab->id() );
171 QPixmap icon( loadSmooth( iconset ) ); 171 QPixmap icon( loadSmooth( iconset ) );
172 tab->setText( label ); 172 tab->setText( label );
173 if ( tabBarStyle == IconTab ) 173 if ( tabBarStyle == IconTab )
174 tab->setIconSet( icon ); 174 tab->setIconSet( icon );
175 int i = 0; 175 int i = 0;
176 while ( i < tabList->count() && tabList->text( i ) != currtab->label() ) 176 while ( i < tabList->count() && tabList->text( i ) != currtab->label() )
177 { 177 {
178 i++; 178 i++;
179 } 179 }
180 if ( i < tabList->count() && tabList->text( i ) == currtab->label() ) 180 if ( i < tabList->count() && tabList->text( i ) == currtab->label() )
181 { 181 {
182 if ( tabBarStyle == IconTab || tabBarStyle == IconList ) 182 if ( tabBarStyle == IconTab || tabBarStyle == IconList )
183 { 183 {
184 tabList->changeItem( icon, label, i ); 184 tabList->changeItem( icon, label, i );
185 } 185 }
186 else 186 else
187 { 187 {
188 tabList->changeItem( label, i ); 188 tabList->changeItem( label, i );
189 } 189 }
190 } 190 }
191 currtab->setLabel( label ); 191 currtab->setLabel( label );
192 currtab->setIcon( iconset ); 192 currtab->setIcon( iconset );
193 } 193 }
194 setUpLayout(); 194 setUpLayout();
195} 195}
196 196
197void OTabWidget::setCurrentTab( QWidget *childwidget ) 197void OTabWidget::setCurrentTab( QWidget *childwidget )
198{ 198{
199 OTabInfo *currtab = tabs.first(); 199 OTabInfo *currtab = tabs.first();
200 while ( currtab && currtab->control() != childwidget ) 200 while ( currtab && currtab->control() != childwidget )
201 { 201 {
202 currtab = tabs.next(); 202 currtab = tabs.next();
203 } 203 }
204 if ( currtab && currtab->control() == childwidget ) 204 if ( currtab && currtab->control() == childwidget )
205 { 205 {
206 selectTab( currtab ); 206 selectTab( currtab );
207 } 207 }
208} 208}
209 209
210void OTabWidget::setCurrentTab( const QString &tabname ) 210void OTabWidget::setCurrentTab( const QString &tabname )
211{ 211{
212 OTabInfo *newtab = tabs.first(); 212 OTabInfo *newtab = tabs.first();
213 while ( newtab && newtab->label() != tabname ) 213 while ( newtab && newtab->label() != tabname )
214 { 214 {
215 newtab = tabs.next(); 215 newtab = tabs.next();
216 } 216 }
217 if ( newtab && newtab->label() == tabname ) 217 if ( newtab && newtab->label() == tabname )
218 { 218 {
219 selectTab( newtab ); 219 selectTab( newtab );
220 } 220 }
221} 221}
222 222
223void OTabWidget::setCurrentTab(int tabindex) { 223void OTabWidget::setCurrentTab(int tabindex) {
224 OTabInfo *newtab = tabs.first(); 224 OTabInfo *newtab = tabs.first();
225 while ( newtab && newtab->id() != tabindex ) 225 while ( newtab && newtab->id() != tabindex )
226 { 226 {
227 newtab = tabs.next(); 227 newtab = tabs.next();
228 } 228 }
229 if ( newtab && newtab->id() == tabindex ) 229 if ( newtab && newtab->id() == tabindex )
230 { 230 {
231 selectTab( newtab ); 231 selectTab( newtab );
232 } 232 }
233} 233}
234 234
235 235
236OTabWidget::TabStyle OTabWidget::tabStyle() const 236OTabWidget::TabStyle OTabWidget::tabStyle() const
237{ 237{
238 return tabBarStyle; 238 return tabBarStyle;
239} 239}
240 240
241void OTabWidget::setTabStyle( TabStyle s ) 241void OTabWidget::setTabStyle( TabStyle s )
242{ 242{
243 tabBarStyle = s; 243 tabBarStyle = s;
244 if ( tabBarStyle == TextTab || tabBarStyle == IconTab ) 244 if ( tabBarStyle == TextTab || tabBarStyle == IconTab )
245 { 245 {
246 QTab *currtab; 246 QTab *currtab;
247 for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() ) 247 for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() )
248 { 248 {
249 currtab = tabBar->tab( tabinfo->id() ); 249 currtab = tabBar->tab( tabinfo->id() );
250 if ( tabBarStyle == IconTab ) 250 if ( tabBarStyle == IconTab )
251 { 251 {
252 currtab->iconset = new QIconSet( loadSmooth( tabinfo->icon() ) ); 252 currtab->iconset = new QIconSet( loadSmooth( tabinfo->icon() ) );
253 if ( tabinfo == currentTab ) 253 if ( tabinfo == currentTab )
254 currtab->setText( tabinfo->label() ); 254 currtab->setText( tabinfo->label() );
255 else 255 else
256 currtab->setText( QString::null ); 256 currtab->setText( QString::null );
257 } 257 }
258 else 258 else
259 { 259 {
260 currtab->iconset = 0x0; 260 currtab->iconset = 0x0;
261 currtab->setText( tabinfo->label() ); 261 currtab->setText( tabinfo->label() );
262 } 262 }
263 } 263 }
264 tabBarStack->raiseWidget( tabBar ); 264 tabBarStack->raiseWidget( tabBar );
265 } 265 }
266 else if ( tabBarStyle == TextList || tabBarStyle == IconList ) 266 else if ( tabBarStyle == TextList || tabBarStyle == IconList )
267 { 267 {
268 tabList->clear(); 268 tabList->clear();
269 for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() ) 269 for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() )
270 { 270 {
271 if ( tabBarStyle == IconList ) 271 if ( tabBarStyle == IconList )
272 { 272 {
273 tabList->insertItem( loadSmooth( tabinfo->icon() ), tabinfo->label() ); 273 tabList->insertItem( loadSmooth( tabinfo->icon() ), tabinfo->label() );
274 } 274 }
275 else 275 else
276 { 276 {
277 tabList->insertItem( tabinfo->label() ); 277 tabList->insertItem( tabinfo->label() );
278 } 278 }
279 } 279 }
280 tabBarStack->raiseWidget( tabList ); 280 tabBarStack->raiseWidget( tabList );
281 } 281 }
282 setUpLayout(); 282 setUpLayout();
283} 283}
284 284
285OTabWidget::TabPosition OTabWidget::tabPosition() const 285OTabWidget::TabPosition OTabWidget::tabPosition() const
286{ 286{
287 return tabBarPosition; 287 return tabBarPosition;
288} 288}
289 289
290void OTabWidget::setTabPosition( TabPosition p ) 290void OTabWidget::setTabPosition( TabPosition p )
291{ 291{
292 tabBarPosition = p; 292 tabBarPosition = p;
293 if ( tabBarPosition == Top ) 293 if ( tabBarPosition == Top )
294 { 294 {
295 tabBar->setShape( QTabBar::RoundedAbove ); 295 tabBar->setShape( QTabBar::RoundedAbove );
296 } 296 }
297 else 297 else
298 { 298 {
299 tabBar->setShape( QTabBar::RoundedBelow ); 299 tabBar->setShape( QTabBar::RoundedBelow );
300 } 300 }
301 setUpLayout(); 301 setUpLayout();
302} 302}
303 303
304void OTabWidget::slotTabBarSelected( int id ) 304void OTabWidget::slotTabBarSelected( int id )
305{ 305{
306 OTabInfo *newtab = tabs.first(); 306 OTabInfo *newtab = tabs.first();
307 while ( newtab && newtab->id() != id ) 307 while ( newtab && newtab->id() != id )
308 { 308 {
309 newtab = tabs.next(); 309 newtab = tabs.next();
310 } 310 }
311 if ( newtab && newtab->id() == id ) 311 if ( newtab && newtab->id() == id )
312 { 312 {
313 selectTab( newtab ); 313 selectTab( newtab );
314 } 314 }
315} 315}
316 316
317void OTabWidget::slotTabListSelected( int index ) 317void OTabWidget::slotTabListSelected( int index )
318{ 318{
319 OTabInfo *newtab = tabs.at( index ); 319 OTabInfo *newtab = tabs.at( index );
320 if ( newtab ) 320 if ( newtab )
321 { 321 {
322 selectTab( newtab ); 322 selectTab( newtab );
323 } 323 }
324} 324}
325 325
326QPixmap OTabWidget::loadSmooth( const QString &name ) 326QPixmap OTabWidget::loadSmooth( const QString &name )
327{ 327{
328 QImage image = Resource::loadImage( name ); 328 QImage image = Resource::loadImage( name );
329 QPixmap pixmap; 329 QPixmap pixmap;
330 pixmap.convertFromImage( image.smoothScale( 16, 16 ) ); 330 pixmap.convertFromImage( image.smoothScale( 14, 14 ) );
331 return pixmap; 331 return pixmap;
332} 332}
333 333
334void OTabWidget::selectTab( OTabInfo *tab ) 334void OTabWidget::selectTab( OTabInfo *tab )
335{ 335{
336 if ( tabBarStyle == IconTab ) 336 if ( tabBarStyle == IconTab )
337 { 337 {
338 if ( currentTab ) 338 if ( currentTab )
339 { 339 {
340 tabBar->tab( currentTab->id() )->setText( QString::null ); 340 tabBar->tab( currentTab->id() )->setText( QString::null );
341 setUpLayout(); 341 setUpLayout();
342 } 342 }
343 tabBar->tab( tab->id() )->setText( tab->label() ); 343 tabBar->tab( tab->id() )->setText( tab->label() );
344 tabBar->setCurrentTab( tab->id() ); 344 tabBar->setCurrentTab( tab->id() );
345 setUpLayout(); 345 setUpLayout();
346 tabBar->update(); 346 tabBar->update();
347 } 347 }
348 else 348 else
349 { 349 {
350 tabBar->setCurrentTab( tab->id() ); 350 tabBar->setCurrentTab( tab->id() );
351 } 351 }
352 352
353 widgetStack->raiseWidget( tab->control() ); 353 widgetStack->raiseWidget( tab->control() );
354 354
355 emit currentChanged( tab->control() ); 355 emit currentChanged( tab->control() );
356 356
357 currentTab = tab; 357 currentTab = tab;
358} 358}
359 359
360void OTabWidget::setUpLayout() 360void OTabWidget::setUpLayout()
361{ 361{
362 tabBar->layoutTabs(); 362 tabBar->layoutTabs();
363 QSize t( tabBarStack->sizeHint() ); 363 QSize t( tabBarStack->sizeHint() );
364 if ( tabBarStyle == IconTab ) 364 if ( tabBarStyle == IconTab )
365 { 365 {
366 if ( t.width() > width() ) 366 if ( t.width() > width() )
367 t.setWidth( width() ); 367 t.setWidth( width() );
368 } 368 }
369 else 369 else
370 { 370 {
371 t.setWidth( width() ); 371 t.setWidth( width() );
372 } 372 }
373 int lw = widgetStack->lineWidth(); 373 int lw = widgetStack->lineWidth();
374 if ( tabBarPosition == Bottom ) 374 if ( tabBarPosition == Bottom )
375 { 375 {
376 tabBarStack->setGeometry( QMAX(0, lw-2), height() - t.height() - lw, t.width(), t.height() ); 376 tabBarStack->setGeometry( QMAX(0, lw-2), height() - t.height() - lw, t.width(), t.height() );
377 widgetStack->setGeometry( 0, 0, width(), height()-t.height()+QMAX(0, lw-2) ); 377 widgetStack->setGeometry( 0, 0, width(), height()-t.height()+QMAX(0, lw-2) );
378 } 378 }
379 else 379 else
380 { 380 {
381 tabBarStack->setGeometry( QMAX(0, lw-2), 0, t.width(), t.height() ); 381 tabBarStack->setGeometry( QMAX(0, lw-2), 0, t.width(), t.height() );
382 widgetStack->setGeometry( 0, t.height()-lw, width(), height()-t.height()+QMAX( 0, lw-2 ) ); 382 widgetStack->setGeometry( 0, t.height()-lw, width(), height()-t.height()+QMAX( 0, lw-2 ) );
383 } 383 }
384 384
385 if ( autoMask() ) 385 if ( autoMask() )
386 updateMask(); 386 updateMask();
387} 387}
388 388
389QSize OTabWidget::sizeHint() const 389QSize OTabWidget::sizeHint() const
390{ 390{
391 QSize s( widgetStack->sizeHint() ); 391 QSize s( widgetStack->sizeHint() );
392 QSize t( tabBarStack->sizeHint() ); 392 QSize t( tabBarStack->sizeHint() );
393 return QSize( QMAX( s.width(), t.width() ), s.height() + t.height() ); 393 return QSize( QMAX( s.width(), t.width() ), s.height() + t.height() );
394} 394}
395 395
396void OTabWidget::resizeEvent( QResizeEvent * ) 396void OTabWidget::resizeEvent( QResizeEvent * )
397{ 397{
398 setUpLayout(); 398 setUpLayout();
399} 399}
400 400
401int OTabWidget::getCurrentTab() 401int OTabWidget::getCurrentTab()
402{ 402{
403 if ( currentTab ) 403 if ( currentTab )
404 { 404 {
405 return currentTab->id(); 405 return currentTab->id();
406 } 406 }
407 return -1; 407 return -1;
408} 408}
409 409