-rw-r--r-- | libopie2/opieui/otabwidget.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libopie2/opieui/otabwidget.cpp b/libopie2/opieui/otabwidget.cpp index d617a9c..7103884 100644 --- a/libopie2/opieui/otabwidget.cpp +++ b/libopie2/opieui/otabwidget.cpp @@ -112,24 +112,27 @@ void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &lab m_tabList->insertItem( label ); } // Add widget to stack m_widgetStack->addWidget( child, tabid ); m_widgetStack->raiseWidget( child ); m_widgetStack->setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); // Keep track of tab information OTabInfo *tabinfo = new OTabInfo( tabid, child, icon, label ); m_tabs.append( tabinfo ); + // Force resizing of child controls + resizeEvent( 0x0 ); + // Make newly added tab the current one displayed selectTab( tabinfo ); } void OTabWidget::removePage( QWidget *childwidget ) { if ( childwidget ) { // Find tab information for desired widget OTabInfo *tab = m_tabs.first(); while ( tab && tab->control() != childwidget ) tab = m_tabs.next(); @@ -158,24 +161,27 @@ void OTabWidget::removePage( QWidget *childwidget ) // Get rid of tab information m_tabs.remove( tab ); delete tab; // Reset current tab m_currTab = m_tabs.current(); if ( !m_currTab ) m_widgetStack->setFrameStyle( QFrame::NoFrame ); // Redraw widget setUpLayout(); } + + // Force resizing of child controls + resizeEvent( 0x0 ); } } void OTabWidget::changeTab( QWidget *widget, const QString &iconset, const QString &label) { // Find tab information for desired widget OTabInfo *currtab = m_tabs.first(); while ( currtab && currtab->control() != widget ) currtab = m_tabs.next(); if ( currtab && currtab->control() == widget ) { @@ -199,24 +205,27 @@ void OTabWidget::changeTab( QWidget *widget, const QString &iconset, const QStri { if ( m_tabBarStyle == IconList ) m_tabList->changeItem( icon, label, i ); else m_tabList->changeItem( label, i ); } } // Update tab information currtab->setLabel( label ); currtab->setIcon( iconset ); + // Force resizing of child controls + resizeEvent( 0x0 ); + // Redraw widget setUpLayout(); } } void OTabWidget::setCurrentTab( QWidget *childwidget ) { OTabInfo *currtab = m_tabs.first(); while ( currtab && currtab->control() != childwidget ) { currtab = m_tabs.next(); } |