|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.
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<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Field Summary | |
---|---|
QSignalEmitter.Signal1<java.lang.Integer> |
currentChanged
This signal is emitted when the current item is changed. |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QToolBox()
Equivalent to QToolBox(0, 0). |
|
QToolBox(QWidget parent)
Equivalent to QToolBox(parent, 0). |
|
QToolBox(QWidget parent,
Qt.WindowFlags f)
Constructs a new toolbox with the given parent and the flags, 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 widget in a new tab at bottom of the toolbox. |
protected void |
changeEvent(QEvent arg__1)
This function is reimplemented for internal reasons. |
int |
count()
Returns The number of items contained in the toolbox.. |
int |
currentIndex()
Returns The index of the current item, or -1 if the toolbox is empty.. |
QWidget |
currentWidget()
Returns a pointer to the current widget, or 0 if there is no such item. |
boolean |
event(QEvent e)
This function is reimplemented for internal reasons. |
static QToolBox |
fromNativePointer(QNativePointer nativePointer)
This function returns the QToolBox instance pointed to by nativePointer |
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)
Sets The index of the current item, or -1 if the toolbox is empty. to index. |
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. |
protected void |
showEvent(QShowEvent e)
This function is reimplemented for internal reasons. |
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 |
---|
drawFrame, frameRect, frameShadow, frameShape, frameStyle, frameWidth, lineWidth, midLineWidth, paintEvent, setFrameRect, setFrameShadow, setFrameShape, setFrameStyle, setLineWidth, setMidLineWidth, sizeHint |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
disconnect, disconnect, signalSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1<java.lang.Integer> currentChanged
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)
Equivalent to QToolBox(parent, 0).
public QToolBox()
Equivalent to QToolBox(0, 0).
public QToolBox(QWidget parent, Qt.WindowFlags f)
Constructs a new toolbox with the given parent and the flags, f.
Method Detail |
---|
public final int addItem(QWidget widget, java.lang.String text)
Adds the widget widget in a new tab at bottom of the toolbox. The new tab's text is set to text. Returns the new tab's index.
public final int addItem(QWidget widget, QIcon icon, java.lang.String text)
Adds the widget in a new tab at bottom of the toolbox. The new tab's text is set to text, and the icon is displayed to the left of the text. Returns the new tab's index.
public final int count()
Returns The number of items contained in the toolbox..
public final int currentIndex()
Returns The index of the current item, or -1 if the toolbox is empty..
public final QWidget currentWidget()
Returns a pointer to the current widget, or 0 if there is no such item.
public final int indexOf(QWidget widget)
Returns the index of widget, or -1 if the item does not exist.
public final 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. The new item's text is set to text. Returns the new item's index.
public final 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. The new item's text is set to text, and the icon is displayed to the left of the text. Returns the new item's index.
public final boolean isItemEnabled(int index)
Returns true if the item at position index is enabled; otherwise returns false.
public final QIcon itemIcon(int index)
Returns the icon of the item at position index, or a null icon if index is out of range.
public final 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.
public final 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.
public final void removeItem(int index)
Removes the item at position index from the toolbox. Note that the widget is not deleted.
public final void setCurrentIndex(int index)
Sets The index of the current item, or -1 if the toolbox is empty. to index.
public final void setCurrentWidget(QWidget widget)
Makeswidget the current widget. The widget must be an item in this tool box.
public final 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.
public final void setItemIcon(int index, QIcon icon)
Sets the icon of the item at position index to icon.
public final void setItemText(int index, java.lang.String text)
Sets the text of the item at position index to 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 '&&').
public final void setItemToolTip(int index, java.lang.String toolTip)
Sets the tooltip of the item at position index to toolTip.
public final QWidget widget(int index)
Returns the widget at position index, or 0 if there is no such item.
protected void changeEvent(QEvent arg__1)
This function is reimplemented for internal reasons.
changeEvent
in class QFrame
public boolean event(QEvent e)
This function is reimplemented for internal reasons.
event
in class QFrame
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.
protected void showEvent(QShowEvent e)
This function is reimplemented for internal reasons.
showEvent
in class QWidget
visible
,
event,
QShowEventpublic static QToolBox fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |