static class |
QTabWidget.TabPosition
This enum type defines where QTabWidget draws the tab row:
Constant | Value | Description
| North | 0 | The tabs are drawn above the pages. |
static class |
QTabWidget.TabShape
This enum type defines the shape of the tabs. |
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> |
Method Summary |
int |
addTab(QWidget widget,
QIcon icon,
java.lang.String label)
Adds a tab with the given widget, icon, and label to the tab widget, and returns the index of the tab in the tab bar. |
int |
addTab(QWidget widget,
java.lang.String arg__2)
Adds a tab with the given widget and arg__2 to the tab widget, and returns the index of the tab in the tab bar. |
protected void |
changeEvent(QEvent arg__1)
This function is reimplemented for internal reasons. |
void |
clear()
Removes all the pages, but does not delete them. |
QWidget |
cornerWidget()
Equivalent to cornerWidget(Qt::TopRightCorner). |
QWidget |
cornerWidget(Qt.Corner corner)
Returns the widget shown in the corner of the tab widget or 0. |
int |
count()
Returns the number of tabs in the tab bar. |
int |
currentIndex()
Returns the index position of the current tab page. |
QWidget |
currentWidget()
Returns a pointer to the page currently being displayed by the tab dialog. |
Qt.TextElideMode |
elideMode()
Returns how to elide text in the tab bar. |
boolean |
event(QEvent arg__1)
This function is reimplemented for internal reasons. |
static QTabWidget |
fromNativePointer(QNativePointer nativePointer)
This function returns the QTabWidget instance pointed to by nativePointer |
QSize |
iconSize()
Returns The size for icons in the tab bar. |
int |
indexOf(QWidget widget)
Returns the index position of the page occupied by the widget widget, or -1 if the widget cannot be found. |
protected void |
initStyleOption(QStyleOptionTabWidgetFrame option)
Initialize option with the values from this QTabWidget. |
int |
insertTab(int index,
QWidget widget,
QIcon icon,
java.lang.String label)
Inserts a tab with the given label, widget, and icon into the tab widget at the specified index, and returns the index of the inserted tab in the tab bar. |
int |
insertTab(int index,
QWidget widget,
java.lang.String arg__3)
Inserts a tab with the given arg__3 and widget into the tab widget at the specified index, and returns the index of the inserted tab in the tab bar. |
boolean |
isTabEnabled(int index)
Returns true if the the page at position index is enabled; otherwise returns false. |
protected void |
keyPressEvent(QKeyEvent arg__1)
This function is reimplemented for internal reasons. |
QSize |
minimumSizeHint()
This function is reimplemented for internal reasons. |
protected void |
paintEvent(QPaintEvent arg__1)
Paints the tab widget's tab bar in response to the paint arg__1. |
void |
removeTab(int index)
Removes the tab at position index from this stack of widgets. |
protected void |
resizeEvent(QResizeEvent arg__1)
This function is reimplemented for internal reasons. |
void |
setCornerWidget(QWidget w)
Equivalent to setCornerWidget(w, Qt::TopRightCorner). |
void |
setCornerWidget(QWidget w,
Qt.Corner corner)
Sets the given w to be shown in the specified corner of the tab widget. |
void |
setCurrentIndex(int index)
Sets the index position of the current tab page to index. |
void |
setCurrentWidget(QWidget widget)
Makes widget the current widget. |
void |
setElideMode(Qt.TextElideMode arg__1)
Sets how to elide text in the tab bar to arg__1. |
void |
setIconSize(QSize size)
Sets The size for icons in the tab bar to size. |
protected void |
setTabBar(QTabBar arg__1)
Replaces the dialog's QTabBar heading with the tab bar arg__1. |
void |
setTabEnabled(int index,
boolean arg__2)
If arg__2 is true, the page at position index is enabled; otherwise the page at position index is disabled. |
void |
setTabIcon(int index,
QIcon icon)
Sets the icon for the tab at position index. |
void |
setTabPosition(QTabWidget.TabPosition arg__1)
Sets the position of the tabs in this tab widget to arg__1. |
void |
setTabShape(QTabWidget.TabShape s)
Sets the shape of the tabs in this tab widget to s. |
void |
setTabText(int index,
java.lang.String arg__2)
Defines a new arg__2 for the page at position index's tab. |
void |
setTabToolTip(int index,
java.lang.String tip)
Sets the tab tool tip for the page at position index to tip. |
void |
setTabWhatsThis(int index,
java.lang.String text)
Sets the What's This help text for the page at position index to text. |
void |
setUsesScrollButtons(boolean useButtons)
Sets Whether or not a tab bar should use buttons to scroll tabs when it has many tabs. to useButtons. |
protected void |
showEvent(QShowEvent arg__1)
This function is reimplemented for internal reasons. |
QSize |
sizeHint()
This function is reimplemented for internal reasons. |
protected QTabBar |
tabBar()
Returns the current QTabBar. |
QIcon |
tabIcon(int index)
Returns the icon for the tab on the page at position index. |
protected void |
tabInserted(int index)
This virtual handler is called after a new tab was added or inserted at position index. |
QTabWidget.TabPosition |
tabPosition()
Returns the position of the tabs in this tab widget. |
protected void |
tabRemoved(int index)
This virtual handler is called after a tab was removed from position index. |
QTabWidget.TabShape |
tabShape()
Returns the shape of the tabs in this tab widget. |
java.lang.String |
tabText(int index)
Returns the label text for the tab on the page at position index. |
java.lang.String |
tabToolTip(int index)
Returns the tab tool tip for the page at position index or an empty string if no tool tip has been set. |
java.lang.String |
tabWhatsThis(int index)
Returns the What's This help text for the page at position index, or an empty string if no help text has been set. |
boolean |
usesScrollButtons()
Returns Whether or not a tab bar should use buttons to scroll tabs when it has many tabs.. |
QWidget |
widget(int index)
Returns the tab page at index position index or 0 if the index is out of range. |
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, keyReleaseEvent, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, 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, 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 java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
currentChanged
public final QSignalEmitter.Signal1<java.lang.Integer> currentChanged
This signal is emitted whenever the current page index changes. The parameter is the new current page index position.
- Compatible Slot Signatures:
- void mySlot(int index)
- void mySlot()
- See Also:
- currentWidget, currentIndex
QTabWidget
public QTabWidget()
Equivalent to QTabWidget(0).
QTabWidget
public QTabWidget(QWidget parent)
Constructs a tabbed widget with parent parent.
addTab
public final int addTab(QWidget widget,
java.lang.String arg__2)
Adds a tab with the given widget and arg__2 to the tab widget, and returns the index of the tab in the tab bar.
If the tab's arg__2 contains an ampersand, the letter following the ampersand is used as a shortcut for the tab, e.g. if the label is "Bro&wse" then Alt+W becomes a shortcut which will move the focus to this tab.
Note: If you call addTab after show, the layout system will try to adjust to the changes in it's widgets hierarchy and may cause flicker. To prevent this, you can set the QWidget::updatesEnabled property to false prior to changes; remember to set the property to true when the changes are done, making the widget receive paint events again.
- See Also:
- insertTab
addTab
public final int addTab(QWidget widget,
QIcon icon,
java.lang.String label)
Adds a tab with the given widget, icon, and label to the tab widget, and returns the index of the tab in the tab bar.
This function is the same as addTab, but with an additional icon.
clear
public final void clear()
Removes all the pages, but does not delete them. Calling this function is equivalent to calling removeTab until the tab widget is empty.
cornerWidget
public final QWidget cornerWidget()
Equivalent to cornerWidget(Qt::TopRightCorner).
cornerWidget
public final QWidget cornerWidget(Qt.Corner corner)
Returns the widget shown in the corner of the tab widget or 0.
- See Also:
- setCornerWidget
count
public final int count()
Returns the number of tabs in the tab bar.
currentIndex
public final int currentIndex()
Returns the index position of the current tab page.
- See Also:
- setCurrentIndex
currentWidget
public final QWidget currentWidget()
Returns a pointer to the page currently being displayed by the tab dialog. The tab dialog does its best to make sure that this value is never 0 (but if you try hard enough, it can be).
- See Also:
- currentIndex,
setCurrentWidget
elideMode
public final Qt.TextElideMode elideMode()
Returns how to elide text in the tab bar.
This property controls how items are elided when there is not enough space to show them for a given tab bar size.
By default the value is style dependant.
- See Also:
- setElideMode,
QTabBar::elideMode,
usesScrollButtons,
QStyle::SH_TabBar_ElideMode
iconSize
public final QSize iconSize()
Returns The size for icons in the tab bar.
The default value is style-dependent. This is the maximum size that the icons will have. Icons are not scaled up if they are of smaller size.
- See Also:
- setIconSize,
QTabBar::iconSize
indexOf
public final int indexOf(QWidget widget)
Returns the index position of the page occupied by the widget widget, or -1 if the widget cannot be found.
insertTab
public final int insertTab(int index,
QWidget widget,
java.lang.String arg__3)
Inserts a tab with the given arg__3 and widget into the tab widget at the specified index, and returns the index of the inserted tab in the tab bar.
The label is displayed in the tab and may vary in appearance depending on the configuration of the tab widget.
If the tab's arg__3 contains an ampersand, the letter following the ampersand is used as a shortcut for the tab, e.g. if the label is "Bro&wse" then Alt+W becomes a shortcut which will move the focus to this tab.
If index is out of range, the tab is simply appended. Otherwise it is inserted at the specified position.
If the QTabWidget was empty before this function is called, the new page becomes the current page. Inserting a new tab at an index less than or equal to the current index will increment the current index, but keep the current page.
Note: If you call insertTab after show, the layout system will try to adjust to the changes in it's widgets hierarchy and may cause flicker. To prevent this, you can set the QWidget::updatesEnabled property to false prior to changes; remember to set the property to true when the changes are done, making the widget receive paint events again.
- See Also:
- addTab
insertTab
public final int insertTab(int index,
QWidget widget,
QIcon icon,
java.lang.String label)
Inserts a tab with the given label, widget, and icon into the tab widget at the specified index, and returns the index of the inserted tab in the tab bar.
This function is the same as insertTab, but with an additional icon.
isTabEnabled
public final boolean isTabEnabled(int index)
Returns true if the the page at position index is enabled; otherwise returns false.
- See Also:
- setTabEnabled,
QWidget::isEnabled
removeTab
public final void removeTab(int index)
Removes the tab at position index from this stack of widgets. The page widget itself is not deleted.
- See Also:
- addTab,
insertTab
setCornerWidget
public final void setCornerWidget(QWidget w)
Equivalent to setCornerWidget(w, Qt::TopRightCorner).
setCornerWidget
public final void setCornerWidget(QWidget w,
Qt.Corner corner)
Sets the given w to be shown in the specified corner of the tab widget. The geometry of the widget is determined based on the widget's sizeHint and the style.
Only the horizontal element of the corner will be used.
Passing 0 shows no widget in the corner.
Any previously set corner widget is hidden.
All widgets set here will be deleted by the tab widget when it is destroyed unless you separately reparent the widget after setting some other corner widget (or 0).
Note: Corner widgets are designed for North and South tab positions; other orientations are known to not work properly.
- See Also:
- cornerWidget,
setTabPosition
setCurrentIndex
public final void setCurrentIndex(int index)
Sets the index position of the current tab page to index.
- See Also:
- currentIndex
setCurrentWidget
public final void setCurrentWidget(QWidget widget)
Makes widget the current widget. The widget used must be a page in this tab widget.
- See Also:
- addTab,
setCurrentIndex,
currentWidget
setElideMode
public final void setElideMode(Qt.TextElideMode arg__1)
Sets how to elide text in the tab bar to arg__1.
This property controls how items are elided when there is not enough space to show them for a given tab bar size.
By default the value is style dependant.
- See Also:
- QTabBar::elideMode,
usesScrollButtons,
QStyle::SH_TabBar_ElideMode
setIconSize
public final void setIconSize(QSize size)
Sets The size for icons in the tab bar to size.
The default value is style-dependent. This is the maximum size that the icons will have. Icons are not scaled up if they are of smaller size.
- See Also:
- QTabBar::iconSize
setTabBar
protected final void setTabBar(QTabBar arg__1)
Replaces the dialog's QTabBar heading with the tab bar arg__1. Note that this must be called before any tabs have been added, or the behavior is undefined.
- See Also:
- tabBar
setTabEnabled
public final void setTabEnabled(int index,
boolean arg__2)
If arg__2 is true, the page at position index is enabled; otherwise the page at position index is disabled. The page's tab is redrawn appropriately.
QTabWidget uses QWidget::setEnabled() internally, rather than keeping a separate flag.
Note that even a disabled tab/page may be visible. If the page is visible already, QTabWidget will not hide it; if all the pages are disabled, QTabWidget will show one of them.
- See Also:
- isTabEnabled,
QWidget::setEnabled
setTabIcon
public final void setTabIcon(int index,
QIcon icon)
Sets the icon for the tab at position index.
- See Also:
- tabIcon
setTabPosition
public final void setTabPosition(QTabWidget.TabPosition arg__1)
Sets the position of the tabs in this tab widget to arg__1.
Possible values for this property are described by the TabPosition enum.
- See Also:
- tabPosition,
TabPosition
setTabShape
public final void setTabShape(QTabWidget.TabShape s)
Sets the shape of the tabs in this tab widget to s.
Possible values for this property are QTabWidget::Rounded (default) or QTabWidget::Triangular.
- See Also:
- tabShape,
TabShape
setTabText
public final void setTabText(int index,
java.lang.String arg__2)
Defines a new arg__2 for the page at position index's tab.
If the provided text contains an ampersand character ('&'), a shortcut is automatically created for it. The character that follows the '&' will be used as the shortcut key. Any previous shortcut will be overwritten, or cleared if no shortcut is defined by the text. See the QShortcut documentation for details (to display an actual ampersand, use '&&').
- See Also:
- tabText
setTabToolTip
public final void setTabToolTip(int index,
java.lang.String tip)
Sets the tab tool tip for the page at position index to tip.
- See Also:
- tabToolTip
setTabWhatsThis
public final void setTabWhatsThis(int index,
java.lang.String text)
Sets the What's This help text for the page at position index to text.
- See Also:
- tabWhatsThis
setUsesScrollButtons
public final void setUsesScrollButtons(boolean useButtons)
Sets Whether or not a tab bar should use buttons to scroll tabs when it has many tabs. to useButtons.
When there are too many tabs in a tab bar for its size, the tab bar can either choose to expand it's size or to add buttons that allow you to scroll through the tabs.
By default the value is style dependant.
- See Also:
- elideMode,
QTabBar::usesScrollButtons,
QStyle::SH_TabBar_PreferNoArrows
tabBar
protected final QTabBar tabBar()
Returns the current QTabBar.
- See Also:
- setTabBar
tabIcon
public final QIcon tabIcon(int index)
Returns the icon for the tab on the page at position index.
- See Also:
- setTabIcon
tabPosition
public final QTabWidget.TabPosition tabPosition()
Returns the position of the tabs in this tab widget.
Possible values for this property are described by the TabPosition enum.
- See Also:
- setTabPosition,
TabPosition
tabShape
public final QTabWidget.TabShape tabShape()
Returns the shape of the tabs in this tab widget.
Possible values for this property are QTabWidget::Rounded (default) or QTabWidget::Triangular.
- See Also:
- setTabShape,
TabShape
tabText
public final java.lang.String tabText(int index)
Returns the label text for the tab on the page at position index.
- See Also:
- setTabText
tabToolTip
public final java.lang.String tabToolTip(int index)
Returns the tab tool tip for the page at position index or an empty string if no tool tip has been set.
- See Also:
- setTabToolTip
tabWhatsThis
public final java.lang.String tabWhatsThis(int index)
Returns the What's This help text for the page at position index, or an empty string if no help text has been set.
- See Also:
- setTabWhatsThis
usesScrollButtons
public final boolean usesScrollButtons()
Returns Whether or not a tab bar should use buttons to scroll tabs when it has many tabs..
When there are too many tabs in a tab bar for its size, the tab bar can either choose to expand it's size or to add buttons that allow you to scroll through the tabs.
By default the value is style dependant.
- See Also:
- setUsesScrollButtons,
elideMode,
QTabBar::usesScrollButtons,
QStyle::SH_TabBar_PreferNoArrows
widget
public final QWidget widget(int index)
Returns the tab page at index position index or 0 if the index is out of range.
changeEvent
protected void changeEvent(QEvent arg__1)
This function is reimplemented for internal reasons.
- Overrides:
changeEvent in class QWidget
event
public boolean event(QEvent arg__1)
This function is reimplemented for internal reasons.
- Overrides:
event in class QWidget
- See Also:
- closeEvent,
focusInEvent,
focusOutEvent,
enterEvent,
keyPressEvent,
keyReleaseEvent,
leaveEvent,
mouseDoubleClickEvent,
mouseMoveEvent,
mousePressEvent,
mouseReleaseEvent,
moveEvent,
paintEvent,
resizeEvent,
QObject::event,
QObject::timerEvent
keyPressEvent
protected void keyPressEvent(QKeyEvent arg__1)
This function is reimplemented for internal reasons.
- Overrides:
keyPressEvent in class QWidget
- See Also:
- keyReleaseEvent,
QKeyEvent::ignore,
setFocusPolicy,
focusInEvent,
focusOutEvent,
event,
QKeyEvent,
Tetrix Example
minimumSizeHint
public QSize minimumSizeHint()
This function is reimplemented for internal reasons.
- Overrides:
minimumSizeHint in class QWidget
- See Also:
- QSize::isValid,
resize,
setMinimumSize,
sizePolicy
paintEvent
protected void paintEvent(QPaintEvent arg__1)
Paints the tab widget's tab bar in response to the paint arg__1.
- Overrides:
paintEvent in class QWidget
- See Also:
- event,
repaint,
update,
QPainter,
QPixmap,
QPaintEvent,
Analog Clock Example
resizeEvent
protected void resizeEvent(QResizeEvent arg__1)
This function is reimplemented for internal reasons.
- Overrides:
resizeEvent in class QWidget
- See Also:
- moveEvent,
event,
resize,
QResizeEvent,
paintEvent,
Example
showEvent
protected void showEvent(QShowEvent arg__1)
This function is reimplemented for internal reasons.
- Overrides:
showEvent in class QWidget
- See Also:
visible ,
event,
QShowEvent
sizeHint
public QSize sizeHint()
This function is reimplemented for internal reasons.
- Overrides:
sizeHint in class QWidget
- See Also:
- QSize::isValid,
minimumSizeHint,
sizePolicy,
setMinimumSize,
updateGeometry
tabInserted
protected void tabInserted(int index)
This virtual handler is called after a new tab was added or inserted at position index.
- See Also:
- tabRemoved
tabRemoved
protected void tabRemoved(int index)
This virtual handler is called after a tab was removed from position index.
- See Also:
- tabInserted
fromNativePointer
public static QTabWidget fromNativePointer(QNativePointer nativePointer)
- This function returns the QTabWidget instance pointed to by nativePointer
- Parameters:
nativePointer - the QNativePointer of which object should be returned.
initStyleOption
protected final void initStyleOption(QStyleOptionTabWidgetFrame option)
- Initialize option with the values from this QTabWidget. This method
is useful for subclasses when they need a QStyleOptionSlider, but don't want
to fill in all the information themselves.
|