Overview | Package | Class | Tree | Deprecated | Index | Help
Qt Jambi Home |
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.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.
`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`.
`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.gui.QWidget
`acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuEvent, contextMenuPolicy, createWinId, cursor, depth, destroy, destroy, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, 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, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyPressEvent, keyReleaseEvent, 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, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, overrideWindowState, paintEngine, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, 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, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showFullScreen, showMaximized, showMinimized, showNormal, size, 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, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y`

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

### currentChanged

    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.

  Compatible Slot Signatures:
    `void mySlot(int index)`
    `void mySlot()`

Constructor Detail

### QToolBox

    public QToolBox(QWidget parent)

  Equivalent to `QToolBox`(`parent`, 0).

### QToolBox

    public QToolBox()

  Equivalent to `QToolBox`(0, 0).

### 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 `icon` 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 `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.

### count

    public final int count()

  Returns The number of items contained in the toolbox..

### currentIndex

    public final int currentIndex()

  Returns The index of the current item, or -1 if the toolbox is empty..

  See Also:
    `setCurrentIndex`, `indexOf`, `widget`

### currentWidget

    public final QWidget currentWidget()

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

  See Also:
    `currentIndex`, `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,
                                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.

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

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

  Sets The index of the current item, or -1 if the toolbox is empty. to `index`.

  See Also:
    `currentIndex`, `indexOf`, `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`, `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.

### changeEvent

    protected void changeEvent(QEvent arg__1)

  This function is reimplemented for internal reasons.

  Overrides:
    `changeEvent` in class `QFrame`

### event

    public boolean event(QEvent e)

  This function is reimplemented for internal reasons.

  Overrides:
    `event` in class `QFrame`
  See Also:
    `closeEvent`, `focusInEvent`, `focusOutEvent`, `enterEvent`, `keyPressEvent`, `keyReleaseEvent`, `leaveEvent`, `mouseDoubleClickEvent`, `mouseMoveEvent`, `mousePressEvent`, `mouseReleaseEvent`, `moveEvent`, `paintEvent`, `resizeEvent`, `QObject::event`, `QObject::timerEvent`

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

### showEvent

    protected void showEvent(QShowEvent e)

  This function is reimplemented for internal reasons.

  Overrides:
    `showEvent` in class `QWidget`
  See Also:
    `visible`, `event`, `QShowEvent`

### fromNativePointer

    public static QToolBox fromNativePointer(QNativePointer nativePointer)

  This function returns the QToolBox instance pointed to by nativePointer

  Parameters:
    `nativePointer` - the QNativePointer of which object should be returned.

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