You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/qtoolbox.3qt

212 lines
9.2 KiB

'\" t
.TH QToolBox 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QToolBox \- Column of tabbed widget items
.SH SYNOPSIS
\fC#include <qtoolbox.h>\fR
.PP
Inherits QFrame.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQToolBox\fR ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )"
.br
.ti -1c
.BI "int \fBaddItem\fR ( QWidget * w, const QString & label )"
.br
.ti -1c
.BI "int \fBaddItem\fR ( QWidget * item, const QIconSet & iconSet, const QString & label )"
.br
.ti -1c
.BI "int \fBinsertItem\fR ( int index, QWidget * item, const QString & label )"
.br
.ti -1c
.BI "int \fBinsertItem\fR ( int index, QWidget * item, const QIconSet & iconSet, const QString & label )"
.br
.ti -1c
.BI "int \fBremoveItem\fR ( QWidget * item )"
.br
.ti -1c
.BI "void \fBsetItemEnabled\fR ( int index, bool enabled )"
.br
.ti -1c
.BI "bool \fBisItemEnabled\fR ( int index ) const"
.br
.ti -1c
.BI "void \fBsetItemLabel\fR ( int index, const QString & label )"
.br
.ti -1c
.BI "QString \fBitemLabel\fR ( int index ) const"
.br
.ti -1c
.BI "void \fBsetItemIconSet\fR ( int index, const QIconSet & iconSet )"
.br
.ti -1c
.BI "QIconSet \fBitemIconSet\fR ( int index ) const"
.br
.ti -1c
.BI "void \fBsetItemToolTip\fR ( int index, const QString & toolTip )"
.br
.ti -1c
.BI "QString \fBitemToolTip\fR ( int index ) const"
.br
.ti -1c
.BI "QWidget * \fBcurrentItem\fR () const"
.br
.ti -1c
.BI "void \fBsetCurrentItem\fR ( QWidget * item )"
.br
.ti -1c
.BI "int \fBcurrentIndex\fR () const"
.br
.ti -1c
.BI "QWidget * \fBitem\fR ( int index ) const"
.br
.ti -1c
.BI "int \fBindexOf\fR ( QWidget * item ) const"
.br
.ti -1c
.BI "int \fBcount\fR () const"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "void \fBsetCurrentIndex\fR ( int index )"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBcurrentChanged\fR ( int index )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "int \fBcount\fR - the number of items contained in the toolbox \fI(read " "only" ")\fR"
.br
.ti -1c
.BI "int \fBcurrentIndex\fR - the index of the current " "item" ", or -1 if the toolbox is empty"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBitemInserted\fR ( int index )"
.br
.ti -1c
.BI "virtual void \fBitemRemoved\fR ( int index )"
.br
.in -1c
.SH DESCRIPTION
The QToolBox class provides a column of tabbed widget items.
.PP
A toolbox is a widget that displays a column of tabs one above the other, with the current item displayed below the current tab. Every tab has an index position within the column of tabs. A tab's item is a QWidget.
.PP
Each item has an itemLabel(), an optional icon, itemIconSet(), an optional itemToolTip(), and a widget. The item's attributes can be changed with setItemLabel(), setItemIconSet() and setItemToolTip().
.PP
Items are added using addItem(), or inserted at particular positions using insertItem(). The total number of items is given by count(). Items can be deleted with delete, or removed from the toolbox with removeItem(). Combining removeItem() and insertItem() allows to move items to different positions.
.PP
The current item widget is returned by currentItem() and set with setCurrentItem(). If you prefer you can work in terms of indexes using currentIndex(), setCurrentIndex(), indexOf() and item().
.PP
The currentChanged() signal is emitted when the current item is changed.
.PP
See also QTabWidget and Advanced Widgets.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QToolBox::QToolBox ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )"
Constructs a toolbox called \fIname\fR with parent \fIparent\fR and flags \fIf\fR.
.SH "int QToolBox::addItem ( QWidget * item, const QIconSet & iconSet, const QString & label )"
Adds the widget \fIitem\fR in a new tab at bottom of the toolbox. The new tab's label is set to \fIlabel\fR, and the \fIiconSet\fR is displayed to the left of the \fIlabel\fR. Returns the new tab's index.
.SH "int QToolBox::addItem ( QWidget * w, const QString & label )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Adds the widget \fIw\fR in a new tab at bottom of the toolbox. The new tab's label is set to \fIlabel\fR. Returns the new tab's index.
.SH "int QToolBox::count () const"
Returns the number of items contained in the toolbox. See the "count" property for details.
.SH "void QToolBox::currentChanged ( int index )\fC [signal]\fR"
This signal is emitted when the current item changed. The new current item's index is passed in \fIindex\fR, or -1 if there is no current item.
.SH "int QToolBox::currentIndex () const"
Returns the index of the current item, or -1 if the toolbox is empty. See the "currentIndex" property for details.
.SH "QWidget * QToolBox::currentItem () const"
Returns the toolbox's current item, or 0 if the toolbox is empty.
.SH "int QToolBox::indexOf ( QWidget * item ) const"
Returns the index of item \fIitem\fR, or -1 if the item does not exist.
.SH "int QToolBox::insertItem ( int index, QWidget * item, const QIconSet & iconSet, const QString & label )"
Inserts the widget \fIitem\fR at position \fIindex\fR, or at the bottom of the toolbox if \fIindex\fR is out of range. The new item's label is set to \fIlabel\fR, and the \fIiconSet\fR is displayed to the left of the \fIlabel\fR. Returns the new item's index.
.SH "int QToolBox::insertItem ( int index, QWidget * item, const QString & label )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Inserts the widget \fIitem\fR at position \fIindex\fR, or at the bottom of the toolbox if \fIindex\fR is out of range. The new item's label is set to \fIlabel\fR. Returns the new item's index.
.SH "bool QToolBox::isItemEnabled ( int index ) const"
Returns TRUE if the item at position \fIindex\fR is enabled; otherwise returns FALSE.
.SH "QWidget * QToolBox::item ( int index ) const"
Returns the item at position \fIindex\fR, or 0 if there is no such item.
.SH "QIconSet QToolBox::itemIconSet ( int index ) const"
Returns the icon of the item at position \fIindex\fR, or a null icon if \fIindex\fR is out of range.
.SH "void QToolBox::itemInserted ( int index )\fC [virtual protected]\fR"
This virtual handler is called after a new item was added or inserted at position \fIindex\fR.
.SH "QString QToolBox::itemLabel ( int index ) const"
Returns the label of the item at position \fIindex\fR, or a null string if \fIindex\fR is out of range.
.SH "void QToolBox::itemRemoved ( int index )\fC [virtual protected]\fR"
This virtual handler is called after an item was removed from position \fIindex\fR.
.SH "QString QToolBox::itemToolTip ( int index ) const"
Returns the tooltip of the item at position \fIindex\fR, or a null string if \fIindex\fR is out of range.
.SH "int QToolBox::removeItem ( QWidget * item )"
Removes the widget \fIitem\fR from the toolbox. Note that the widget is \fInot\fR deleted. Returns the removed widget's index, or -1 if the widget was not in this tool box.
.SH "void QToolBox::setCurrentIndex ( int index )\fC [slot]\fR"
Sets the index of the current item, or -1 if the toolbox is empty to \fIindex\fR. See the "currentIndex" property for details.
.SH "void QToolBox::setCurrentItem ( QWidget * item )"
Sets the current item to be \fIitem\fR.
.SH "void QToolBox::setItemEnabled ( int index, bool enabled )"
If \fIenabled\fR is TRUE then the item at position \fIindex\fR is enabled; otherwise item \fIindex\fR is disabled.
.SH "void QToolBox::setItemIconSet ( int index, const QIconSet & iconSet )"
Sets the icon of the item at position \fIindex\fR to \fIiconSet\fR.
.SH "void QToolBox::setItemLabel ( int index, const QString & label )"
Sets the label of the item at position \fIindex\fR to \fIlabel\fR.
.SH "void QToolBox::setItemToolTip ( int index, const QString & toolTip )"
Sets the tooltip of the item at position \fIindex\fR to \fItoolTip\fR.
.SS "Property Documentation"
.SH "int count"
This property holds the number of items contained in the toolbox.
.PP
Get this property's value with count().
.SH "int currentIndex"
This property holds the index of the current item, or -1 if the toolbox is empty.
.PP
Set this property's value with setCurrentIndex() and get this property's value with currentIndex().
.PP
See also currentItem(), indexOf(), and item().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qtoolbox.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (qtoolbox.3qt) and the Qt
version (3.3.8).