Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QToolBox

    java.lang.Object
      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

All Implemented Interfaces:
  QPaintDeviceInterface, QtJambiInterface

    public class QToolBox

extends QFrame

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.

See also:
  `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.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9`

Field Summary
`QSignalEmitter.Signal1` | `currentChanged` This signal is emitted when the current item is changed.

Fields inherited from class com.trolltech.qt.gui.QWidget
`customContextMenuRequested`

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)` 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 `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, or -1 if the toolbox is empty.
`QWidget` | `currentWidget()` Returns a pointer to the current widget, or 0 if there is no such item.
`static QToolBox` | `fromNativePointer(QNativePointer nativePointer)` This method 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)` This property holds The index of the current item, or -1 if the toolbox is empty.
`void` | `setCurrentWidget(QWidget widget)` Makes`widget` 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.gui.QWidget
`acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuEvent, contextMenuPolicy, cursor, depth, destroy, destroy, destroy, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, ensurePolished, enterEvent, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isMaximized, isMinimized, isModal, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyPressEvent, keyReleaseEvent, languageChange, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, paintEngine, paintEvent, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setBaseSize, setContentsMargins, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setLocale, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setParent, setParent, setShortcutAutoRepeat, setShortcutAutoRepeat, setShortcutEnabled, setShortcutEnabled, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, underMouse, unsetCursor, unsetLayoutDirection, unsetLocale, update, update, update, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, widthMM, window, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y`

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 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

### currentChanged

    public final QSignalEmitter.Signal1 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

### QToolBox

    public QToolBox(QWidget parent,
                    Qt.WindowType[] f)

  Constructs a new toolbox with the given `parent` and the flags, `f`.

### QToolBox

    public QToolBox(QWidget parent)

  Constructs a new toolbox with the given `parent` and the flags, `f`.

### QToolBox

    public QToolBox()

  Constructs a new toolbox with the given `parent` and the flags, `f`.

### QToolBox

    public QToolBox(QWidget parent,
                    Qt.WindowFlags f)

  Constructs a new toolbox with the given `parent` and the flags, `f`.

Method Detail

### addItem

    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 `iconSet` is displayed to the left of the `text`. Returns the new tab's index.

### addItem

    public final int addItem(QWidget widget,
                             java.lang.String text)

  Adds the widget `w` in a new tab at bottom of the toolbox. The new tab's text is set to `text`. Returns the new tab's index.

### count

    public final int count()

  This property holds The number of items contained in the toolbox.

### currentIndex

    public final int currentIndex()

  This property holds The index of the current item, or -1 if the toolbox is empty.

See also:
  `indexOf()`, and `widget()`.

### currentWidget

    public final QWidget currentWidget()

  Returns a pointer to the current widget, or 0 if there is no such item.

See also:
  `currentIndex()`, and `setCurrentWidget()`.

### indexOf

    public final int indexOf(QWidget widget)

  Returns the index of `widget`, or -1 if the item does not exist.

### insertItem

    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.

### insertItem

    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.

### isItemEnabled

    public final boolean isItemEnabled(int index)

  Returns true if the item at position `index` is enabled; otherwise returns false.

### itemIcon

    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.

See also:
  `setItemIcon()`.

### itemText

    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.

See also:
  `setItemText()`.

### itemToolTip

    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.

See also:
  `setItemToolTip()`.

### removeItem

    public final void removeItem(int index)

  Removes the item at position `index` from the toolbox. Note that the widget is not deleted.

### setCurrentIndex

    public final void setCurrentIndex(int index)

  This property holds The index of the current item, or -1 if the toolbox is empty.

See also:
  `indexOf()`, and `widget()`.

### setCurrentWidget

    public final void setCurrentWidget(QWidget widget)

  Makes`widget` the current widget. The `widget` must be an item in this tool box.

See also:
  `addItem()`, `setCurrentIndex()`, and `currentWidget()`.

### setItemEnabled

    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.

See also:
  `isItemEnabled()`.

### setItemIcon

    public final void setItemIcon(int index,
                                  QIcon icon)

  Sets the icon of the item at position `index` to `icon`.

See also:
  `itemIcon()`.

### setItemText

    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 '&&').

See also:
  `itemText()`.

### setItemToolTip

    public final void setItemToolTip(int index,
                                     java.lang.String toolTip)

  Sets the tooltip of the item at position `index` to `toolTip`.

See also:
  `itemToolTip()`.

### widget

    public final QWidget widget(int index)

  Returns the widget at position `index`, or 0 if there is no such item.

### itemInserted

    protected void itemInserted(int index)

  This virtual handler is called after a new item was added or inserted at position `index`.

See also:
  `itemRemoved()`.

### itemRemoved

    protected void itemRemoved(int index)

  This virtual handler is called after an item was removed from position `index`.

See also:
  `itemInserted()`.

### fromNativePointer

    public static QToolBox fromNativePointer(QNativePointer nativePointer)

  This method returns the QToolBox instance pointed to by `nativePointer`.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD