libopie API Documentation

OTabWidget Class Reference

The OTabWidget class provides a stack of widgets. More...

#include <otabwidget.h>

Inheritance diagram for OTabWidget:

Inheritance graph
[legend]
Collaboration diagram for OTabWidget:

Collaboration graph
[legend]
List of all members.

Public Types

enum  TabStyle {
  Global, TextTab, IconTab, TextList,
  IconList
}
 Defines how the widget selection control is displayed. More...

enum  TabPosition { Top, Bottom }
 Defines where the widget selection control is drawn. More...


Signals

void currentChanged (QWidget *)

Public Member Functions

 OTabWidget (QWidget *=0, const char *=0, TabStyle=Global, TabPosition=Top)
 Object constructor.

 ~OTabWidget ()
 Object destructor.

void addTab (QWidget *, const QString &, const QString &)
 Add new widget to control.

void removePage (QWidget *)
 Remove widget from control. Does not delete widget.

void changeTab (QWidget *, const QString &, const QString &)
 Change text and/or icon for existing tab.

TabStyle tabStyle () const
 Returns current widget selection control style.

void setTabStyle (TabStyle)
 Set the current widget selection control style.

TabPosition tabPosition () const
 Returns current widget selection control position.

void setTabPosition (TabPosition)
 Set the current widget selection control position.

void setCurrentTab (QWidget *)
 Selects and brings to top the desired widget by using widget pointer.

void setCurrentTab (const QString &)
 Selects and brings to top the desired widget, by using label.

void setCurrentTab (int)
 Selects and brings to top the desired widget, by using id.

QSize sizeHint () const
 Reimplemented for internal purposes.

int currentTab ()
 returns current tab id.

QWidgetcurrentWidget () const
 returns the current page of the active tab


Protected Member Functions

void resizeEvent (QResizeEvent *)
 Reimplemented for internal purposes.


Detailed Description

The OTabWidget class provides a stack of widgets.

OTabWidget is a derivation of TrollTech's QTabWidget which provides a stack of widgets. Widgets can be selected using either a tab bar or drop down list box.

The normal way to use OTabWidget is to do the following in the constructor:

Definition at line 61 of file otabwidget.h.


Member Enumeration Documentation

enum OTabWidget::TabStyle
 

Defines how the widget selection control is displayed.

Valid values:

  • Global: use globally selected options (qpe.conf - TabStyle & TabPosition)
  • TextTab: Tabbed widget selection with text labels
  • IconTab: Tabbed widget selection with icon labels, text label for active widget (similar to Opie launcher)
  • TextList: Drop down list widget selection with text labels
  • IconList: Drop down list widget selection with icon & text labels

Definition at line 78 of file otabwidget.h.

Referenced by OTabWidget(), and tabStyle().

enum OTabWidget::TabPosition
 

Defines where the widget selection control is drawn.

Valid values:

  • Top: Widget selection control is drawn above widgets
  • Bottom: Widget selection control is drawn below widgets

Definition at line 88 of file otabwidget.h.

Referenced by tabPosition().


Constructor & Destructor Documentation

OTabWidget::OTabWidget QWidget parent = 0,
const char *  name = 0,
TabStyle  s = Global,
TabPosition  p = Top
 

Object constructor.

Parameters:
parent Pointer to parent of this control.
name Name of control.
s Style of widget selection control.
p Position of the widget selection control.
Constructs a new OTabWidget control with parent and name. The style and position parameters determine how the widget selection control will be displayed.

Definition at line 42 of file otabwidget.cpp.

References QWidgetStack::addWidget(), QObject::connect(), Config::readEntry(), Config::readNumEntry(), QFrame::setFrameStyle(), Config::setGroup(), QFrame::setLineWidth(), setTabPosition(), setTabStyle(), QWidget::style(), and TabStyle.

OTabWidget::~OTabWidget  ) 
 

Object destructor.

Definition at line 86 of file otabwidget.cpp.


Member Function Documentation

OTabWidget::addTab QWidget child,
const QString icon,
const QString label
 

Add new widget to control.

Parameters:
child Widget control.
icon Path to icon.
label Text label.

Definition at line 90 of file otabwidget.cpp.

References QTabBar::addTab(), QWidgetStack::addWidget(), QComboBox::insertItem(), QWidgetStack::raiseWidget(), and QFrame::setFrameStyle().

OTabWidget::removePage QWidget widget  ) 
 

Remove widget from control. Does not delete widget.

Parameters:
widget Widget control to be removed.

Definition at line 127 of file otabwidget.cpp.

References OTabInfo::control(), QComboBox::count(), OTabInfo::id(), OTabInfo::label(), QComboBox::removeItem(), QTabBar::removeTab(), QWidgetStack::removeWidget(), QFrame::setFrameStyle(), QTabBar::setTabEnabled(), QTabBar::tab(), and QComboBox::text().

OTabWidget::changeTab QWidget widget,
const QString icon,
const QString label
 

Change text and/or icon for existing tab.

Parameters:
child Widget control.
icon Path to icon.
label Text label.

Definition at line 163 of file otabwidget.cpp.

References QComboBox::changeItem(), OTabInfo::control(), QComboBox::count(), QWidget::icon(), OTabInfo::id(), OTabInfo::label(), OTabInfo::setIcon(), OTabInfo::setLabel(), QTabBar::tab(), and QComboBox::text().

OTabWidget::tabStyle  )  const
 

Returns current widget selection control style.

Definition at line 238 of file otabwidget.cpp.

References TabStyle.

OTabWidget::setTabStyle TabStyle  s  ) 
 

Set the current widget selection control style.

Parameters:
s New style to be used.

Definition at line 243 of file otabwidget.cpp.

References QComboBox::clear(), OTabInfo::icon(), OTabInfo::id(), QComboBox::insertItem(), OTabInfo::label(), QWidgetStack::raiseWidget(), and QTabBar::tab().

Referenced by OTabWidget().

OTabWidget::tabPosition  )  const
 

Returns current widget selection control position.

Definition at line 287 of file otabwidget.cpp.

References TabPosition.

OTabWidget::setTabPosition TabPosition  p  ) 
 

Set the current widget selection control position.

Parameters:
p New position of widget selection control.

Definition at line 292 of file otabwidget.cpp.

References QTabBar::setShape().

Referenced by OTabWidget().

OTabWidget::setCurrentTab QWidget childwidget  ) 
 

Selects and brings to top the desired widget by using widget pointer.

Parameters:
childwidget Widget to select.

Definition at line 199 of file otabwidget.cpp.

References OTabInfo::control().

OTabWidget::setCurrentTab const QString tabname  ) 
 

Selects and brings to top the desired widget, by using label.

Parameters:
tabname Text label for widget to select.

Definition at line 212 of file otabwidget.cpp.

References OTabInfo::label().

OTabWidget::setCurrentTab int  tabindex  ) 
 

Selects and brings to top the desired widget, by using id.

Parameters:
tab id for widget to select.

Definition at line 225 of file otabwidget.cpp.

References OTabInfo::id().

OTabWidget::sizeHint  )  const
 

Reimplemented for internal purposes.

Reimplemented from QWidget.

Definition at line 390 of file otabwidget.cpp.

References QSize::height(), QWidget::sizeHint(), and QSize::width().

OTabWidget::currentTab  ) 
 

returns current tab id.

Definition at line 402 of file otabwidget.cpp.

References OTabInfo::id().

QWidget * OTabWidget::currentWidget  )  const
 

returns the current page of the active tab

Since:
1.2

Definition at line 411 of file otabwidget.cpp.

OTabWidget::resizeEvent QResizeEvent  )  [protected]
 

Reimplemented for internal purposes.

Reimplemented from QWidget.

Definition at line 397 of file otabwidget.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:25:03 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001