QToolBox Class Reference
The QToolBox class provides a column of tabbed widgets.
More...
#include <qtoolbox.h>
Inherits QWidget.
List of all member functions.
Public Members
QToolBox ( QWidget * parent = 0, const char * name = 0 )
void
addPage ( QWidget * page, const QString & label )
void
addPage ( QWidget * page, const QIconSet & iconSet, const QString & label )
void
insertPage ( QWidget * page, const QString & label, int index = -1 )
void
insertPage ( QWidget * page, const QIconSet & iconSet, const QString & label, int index = -1 )
QWidget *
page ( int index ) const
int
indexOf ( QWidget * page ) const
Public Slots
Signals
Properties
int
count - the number of pages contained in the toolbox
(read only)
BackgroundMode
pageBackgroundMode - the background mode in which the current page should be displayed. If this pageBackgroundMode is set to something else than NoBackground, the background mode is also set to all children of the pages
Detailed Description
The QToolBox class provides a column of tabbed widgets.
A toolbox is a widget that displays a column of tabs one above the
other, with the current page displayed below the current tab.
Every tab has an index position within the column of tabs. A tab's
page is a QWidget.
Each tab has a pageLabel(), an optional icon, pageIconSet(), an
optional pageToolTip(), and a widget. The
tab's attributes can be changed with setPageLabel(),
setPageIconSet() and setPageToolTip().
Pages are added using addPage(), or inserted at particular
positions using insertPage(). Pages are deleted with removePage().
The total number of pages is given by count().
The current page is returned by currentPage() and set with
setCurrentPage(). If you prefer you can work in terms of indexes
using currentIndex(), setCurrentIndex(), indexOf() and page().
The currentChanged() signal is emitted when the current page
is changed.
See also QTabWidget and Advanced Widgets.
Member Function Documentation
QToolBox::QToolBox ( QWidget * parent = 0, const char * name = 0 )
Constructs a toolbox called name with parent parent.
void QToolBox::addPage ( QWidget * page, const QIconSet & iconSet, const QString & label )
Adds the widget page in a new tab at bottom of the toolbox. The
new tab's label is set to label, and the iconSet is
displayed to the left of the label.
void QToolBox::addPage ( QWidget * page, const QString & label )
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Adds the widget page in a new tab at bottom of the toolbox. The
new tab's label is set to label.
int QToolBox::count () const
Returns the number of pages contained in the toolbox.
See the "count" property for details.
void QToolBox::currentChanged ( int index ) [signal]
This signal is emitted when the current page is changed. The index
position of the new current page is passed in index.
int QToolBox::currentIndex () const
Returns the current page's index position.
See the "currentIndex" property for details.
QWidget * QToolBox::currentPage () const
Returns the toolbox's current page.
int QToolBox::indexOf ( QWidget * page ) const
Returns the index position of page page.
void QToolBox::insertPage ( QWidget * page, const QIconSet & iconSet, const QString & label, int index = -1 )
Inserts the widget page in a new tab at position index. The
new tab's label is set to label, and the iconSet is
displayed to the left of the label.
void QToolBox::insertPage ( QWidget * page, const QString & label, int index = -1 )
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Inserts the widget page in a new tab at position index. The
new tab's label is set to label.
bool QToolBox::isPageEnabled ( QWidget * page ) const
Returns TRUE if page page is enabled; otherwise returns FALSE.
QWidget * QToolBox::page ( int index ) const
Returns the page at position index.
BackgroundMode QToolBox::pageBackgroundMode () const
Returns the background mode in which the current page should be displayed. If this pageBackgroundMode is set to something else than NoBackground, the background mode is also set to all children of the pages.
See the "pageBackgroundMode" property for details.
QIconSet QToolBox::pageIconSet ( QWidget * page ) const
Returns page page's tab icon.
QString QToolBox::pageLabel ( QWidget * page ) const
Returns page page's tab label.
QString QToolBox::pageToolTip ( QWidget * page ) const
Returns page page's tooltip.
void QToolBox::removePage ( QWidget * page )
Removes the widget page from the toolbox. Note that the page
is not deleted.
void QToolBox::setCurrentIndex ( int index ) [slot]
Sets the current page's index position to index.
See the "currentIndex" property for details.
void QToolBox::setCurrentPage ( QWidget * page )
Sets the current page to be page.
void QToolBox::setPageBackgroundMode ( BackgroundMode bm )
Sets the background mode in which the current page should be displayed. If this pageBackgroundMode is set to something else than NoBackground, the background mode is also set to all children of the pages to bm.
See the "pageBackgroundMode" property for details.
void QToolBox::setPageEnabled ( QWidget * page, bool enabled )
If enabled is TRUE then page page is enabled; otherwise page
page is disabled.
void QToolBox::setPageIconSet ( QWidget * page, const QIconSet & iconSet )
Sets the tab icon of page page to iconSet.
void QToolBox::setPageLabel ( QWidget * page, const QString & label )
Sets the tab label of page page to label.
void QToolBox::setPageToolTip ( QWidget * page, const QString & toolTip )
Sets the tab tooltip of page page to toolTip.
Property Documentation
int count
This property holds the number of pages contained in the toolbox.
Get this property's value with count().
int currentIndex
This property holds the current page's index position.
Set this property's value with setCurrentIndex() and get this property's value with currentIndex().
This property holds the background mode in which the current page should be displayed. If this pageBackgroundMode is set to something else than NoBackground, the background mode is also set to all children of the pages.
Set this property's value with setPageBackgroundMode() and get this property's value with pageBackgroundMode().
This file is part of the Qt toolkit.
Copyright © 1995-2003
Trolltech. All Rights Reserved.