|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QFrame
com.trolltech.qt.gui.QToolBox
public class QToolBox
The QToolBox class provides a column of tabbed widget items. 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
.
Each item has an itemText()
, an optional itemIcon()
, an optional itemToolTip()
, and a widget()
. The item's attributes can be changed with setItemText()
, setItemIcon()
, and setItemToolTip()
. Each item can be enabled or disabled individually with setItemEnabled()
.
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 you to move items to different positions.
The index of the current item widget is returned by currentIndex()
, and set with setCurrentIndex()
. The index of a particular item can be found using indexOf()
, and the item at a given index is returned by item().
The currentChanged()
signal is emitted when the current item is changed.
QTabWidget
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QFrame |
---|
QFrame.Shadow, QFrame.Shape, QFrame.StyleMask |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary | |
---|---|
QSignalEmitter.Signal1 |
currentChanged
This signal takes 1 generic argument(s). |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QToolBox()
Constructs a new toolbox with the given parent and the flags, f. |
|
QToolBox(QWidget parent)
Constructs a new toolbox with the given parent and the flags, f. |
|
QToolBox(QWidget parent,
Qt.WindowFlags f)
Constructs a new toolbox with the given parent and the flags, f. |
|
QToolBox(QWidget parent,
Qt.WindowType[] f)
|
Method Summary | |
---|---|
int |
addItem(QWidget widget,
QIcon icon,
java.lang.String text)
Adds the widget in a new tab at bottom of the toolbox. |
int |
addItem(QWidget widget,
java.lang.String text)
Adds the widget w in a new tab at bottom of the toolbox. |
int |
count()
This property holds The number of items contained in the toolbox. |
int |
currentIndex()
This property holds the index of the current item. |
QWidget |
currentWidget()
Returns a pointer to the current widget, or 0 if there is no such item. |
int |
indexOf(QWidget widget)
Returns the index of widget, or -1 if the item does not exist. |
int |
insertItem(int index,
QWidget widget,
QIcon icon,
java.lang.String text)
Inserts the widget at position index, or at the bottom of the toolbox if index is out of range. |
int |
insertItem(int index,
QWidget widget,
java.lang.String text)
Inserts the widget at position index, or at the bottom of the toolbox if index is out of range. |
boolean |
isItemEnabled(int index)
Returns true if the item at position index is enabled; otherwise returns false. |
QIcon |
itemIcon(int index)
Returns the icon of the item at position index, or a null icon if index is out of range. |
protected void |
itemInserted(int index)
This virtual handler is called after a new item was added or inserted at position index. |
protected void |
itemRemoved(int index)
This virtual handler is called after an item was removed from position index. |
java.lang.String |
itemText(int index)
Returns the text of the item at position index, or an empty string if index is out of range. |
java.lang.String |
itemToolTip(int index)
Returns the tooltip of the item at position index, or an empty string if index is out of range. |
void |
removeItem(int index)
Removes the item at position index from the toolbox. |
void |
setCurrentIndex(int index)
This property holds the index of the current item. |
void |
setCurrentWidget(QWidget widget)
Makeswidget the current widget. |
void |
setItemEnabled(int index,
boolean enabled)
If enabled is true then the item at position index is enabled; otherwise the item at position index is disabled. |
void |
setItemIcon(int index,
QIcon icon)
Sets the icon of the item at position index to icon. |
void |
setItemText(int index,
java.lang.String text)
Sets the text of the item at position index to text. |
void |
setItemToolTip(int index,
java.lang.String toolTip)
Sets the tooltip of the item at position index to toolTip. |
QWidget |
widget(int index)
Returns the widget at position index, or 0 if there is no such item. |
Methods inherited from class com.trolltech.qt.gui.QFrame |
---|
frameRect, frameShadow, frameShape, frameStyle, frameWidth, lineWidth, midLineWidth, setFrameRect, setFrameShadow, setFrameShape, setFrameStyle, setLineWidth, setMidLineWidth |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1 currentChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: index)>:
This signal is emitted when the current item is changed. The new current item's index is passed in index, or -1 if there is no current item.
Constructor Detail |
---|
public QToolBox(QWidget parent, Qt.WindowType[] f)
public QToolBox(QWidget parent)
public QToolBox()
public QToolBox(QWidget parent, Qt.WindowFlags f)
Method Detail |
---|
public final int addItem(QWidget widget, QIcon icon, java.lang.String text)
public final int addItem(QWidget widget, java.lang.String text)
public final int count()
public final int currentIndex()
indexOf()
, and widget()
.
public final QWidget currentWidget()
currentIndex()
, and setCurrentWidget()
.
public final int indexOf(QWidget widget)
public final int insertItem(int index, QWidget widget, QIcon icon, java.lang.String text)
public final int insertItem(int index, QWidget widget, java.lang.String text)
public final boolean isItemEnabled(int index)
public final QIcon itemIcon(int index)
setItemIcon()
.
public final java.lang.String itemText(int index)
setItemText()
.
public final java.lang.String itemToolTip(int index)
setItemToolTip()
.
public final void removeItem(int index)
public final void setCurrentIndex(int index)
indexOf()
, and widget()
.
public final void setCurrentWidget(QWidget widget)
addItem()
, setCurrentIndex()
, and currentWidget()
.
public final void setItemEnabled(int index, boolean enabled)
isItemEnabled()
.
public final void setItemIcon(int index, QIcon icon)
itemIcon()
.
public final void setItemText(int index, java.lang.String text)
If the provided text contains an ampersand character ('&'), a mnemonic is automatically created for it. The character that follows the '&' will be used as the shortcut key. Any previous mnemonic will be overwritten, or cleared if no mnemonic is defined by the text. See the QShortcut
documentation for details (to display an actual ampersand, use '&&').
itemText()
.
public final void setItemToolTip(int index, java.lang.String toolTip)
itemToolTip()
.
public final QWidget widget(int index)
protected void itemInserted(int index)
itemRemoved()
.
protected void itemRemoved(int index)
itemInserted()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |