<class name="QTabBar" doc="/** <p>The <a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a> class provides a tab bar, e.g&#x2e; for use in tabbed dialogs.</p> <p><a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a> is straightforward to use; it draws the tabs using one of the predefined shapes</tt>, and emits a signal when a tab is selected. It can be subclassed to tailor the look and feel. Qt also provides a ready-made <a href="QTabWidget.html"><tt>QTabWidget</tt></a>.</p> <p>Each tab has a <a href="QTabBar.html#tabText(int)"><tt>tabText</tt></a>, an optional <a href="QTabBar.html#tabIcon(int)"><tt>tabIcon</tt></a>, an optional <a href="QTabBar.html#tabToolTip(int)"><tt>tabToolTip</tt></a>, optional <a href="QTabBar.html#tabWhatsThis(int)"><tt>tabWhatsThis</tt></a> and optional <a href="QTabBar.html#tabData(int)"><tt>tabData</tt></a>. The tabs's attributes can be changed with <a href="QTabBar.html#setTabText(int, java.lang.String)"><tt>setTabText</tt></a>, <a href="QTabBar.html#setTabIcon(int, com.trolltech.qt.gui.QIcon)"><tt>setTabIcon</tt></a>, <a href="QTabBar.html#setTabToolTip(int, java.lang.String)"><tt>setTabToolTip</tt></a>, <a href="QTabBar.html#setTabWhatsThis(int, java.lang.String)"><tt>setTabWhatsThis</tt></a> and <a href="QTabBar.html#setTabData(int, java.lang.Object)"><tt>setTabData</tt></a>. Each tabs can be enabled or disabled individually with <a href="QTabBar.html#setTabEnabled(int, boolean)"><tt>setTabEnabled</tt></a>.</p> <p>Each tab can display text in a distinct color. The current text color for a tab can be found with the <a href="QTabBar.html#tabTextColor(int)"><tt>tabTextColor</tt></a> function. Set the text color for a particular tab with <a href="QTabBar.html#setTabTextColor(int, com.trolltech.qt.gui.QColor)"><tt>setTabTextColor</tt></a>.</p> <p>Tabs are added using <a href="QTabBar.html#addTab(java.lang.String)"><tt>addTab</tt></a>, or inserted at particular positions using <a href="QTabBar.html#insertTab(int, java.lang.String)"><tt>insertTab</tt></a>. The total number of tabs is given by <a href="QTabBar.html#count()"><tt>count</tt></a>. Tabs can be removed from the tab bar with <a href="QTabBar.html#removeTab(int)"><tt>removeTab</tt></a>. Combining <a href="QTabBar.html#removeTab(int)"><tt>removeTab</tt></a> and <a href="QTabBar.html#insertTab(int, java.lang.String)"><tt>insertTab</tt></a> allows you to move tabs to different positions.</p> <p>The <a href="QTabBar.html#shape()">shape</tt></a> property defines the tabs' appearance. The choice of shape is a matter of taste, although tab dialogs (for preferences and similar) invariably use <a href="QTabBar.html#Shape-enum"><tt>RoundedNorth</tt></a>. Tab controls in windows other than dialogs almost always use either <a href="QTabBar.html#Shape-enum"><tt>RoundedSouth</tt></a> or <a href="QTabBar.html#Shape-enum"><tt>TriangularSouth</tt></a>. Many spreadsheets and other tab controls in which all the pages are essentially similar use <a href="QTabBar.html#Shape-enum"><tt>TriangularSouth</tt></a>, whereas <a href="QTabBar.html#Shape-enum"><tt>RoundedSouth</tt></a> is used mostly when the pages are different (e.g&#x2e; a multi-page tool palette). The default in <a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a> is <a href="QTabBar.html#Shape-enum"><tt>RoundedNorth</tt></a>.</p> <p>The most important part of <a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a>'s API is the <a href="QTabBar.html#currentChanged(int)"><tt>currentChanged</tt></a> signal. This is emitted whenever the current tab changes (even at startup, when the current tab changes from 'none'). There is also a slot, <a href="QTabBar.html#setCurrentIndex(int)"><tt>setCurrentIndex</tt></a>, which can be used to select a tab programmatically. The function <a href="QTabBar.html#currentIndex()"><tt>currentIndex</tt></a> returns the index of the current tab, <a href="QTabBar.html#count()">count</tt></a> holds the number of tabs.</p> <p><a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a> creates automatic mnemonic keys in the manner of <a href="QAbstractButton.html"><tt>QAbstractButton</tt></a>; e.g&#x2e; if a tab's label is &quot;&amp;Graphics&quot;, Alt+G becomes a shortcut key for switching to that tab.</p> <p>The following virtual functions may need to be reimplemented in order to tailor the look and feel or store extra data with each tab:</p> <ul> <li><a href="QTabBar.html#tabSizeHint(int)"><tt>tabSizeHint</tt></a> calcuates the size of a tab.</li> <li><a href="QTabBar.html#tabInserted(int)"><tt>tabInserted</tt></a> notifies that a new tab was added.</li> <li><a href="QTabBar.html#tabRemoved(int)"><tt>tabRemoved</tt></a> notifies that a tab was removed.</li> <li><a href="QTabBar.html#tabLayoutChange()"><tt>tabLayoutChange</tt></a> notifies that the tabs have been re-laid out.</li> <li><a href="QTabBar.html#paintEvent(com.trolltech.qt.gui.QPaintEvent)"><tt>paintEvent</tt></a> paints all tabs.</li> </ul> <p>For subclasses, you might also need the <a href="QTabBar.html#tabRect(int)"><tt>tabRect</tt></a> functions which returns the visual geometry of a single tab.</p> <p><table width="100%" align="center" cellpadding="2" cellspacing="1" border="0"> <tr valign="top" class="odd"><td><img src="%2E%2E/images/plastique-tabbar.png" alt="Screenshot of a Plastique style tab bar" /></td><td>A tab bar shown in the Plastique widget style.</td></tr> <tr valign="top" class="even"><td><img src="%2E%2E/images/plastique-tabbar-truncated.png" alt="Screenshot of a truncated Plastique tab bar" /></td><td>A truncated tab bar shown in the Plastique widget style.</td></tr> </table></p> @see <a href="QTabWidget.html"><tt>QTabWidget</tt></a> */"> <signal name="protected final void currentChanged(int index)" doc="/** <p>This signal is emitted when the tab bar's current tab changes. The new current has the given <tt>index</tt>.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(int index)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <signal name="protected final void customContextMenuRequested(com.trolltech.qt.core.QPoint pos)" doc="/** <p>This signal is emitted when the widget's <a href="QWidget.html#contextMenuPolicy()"><tt>contextMenuPolicy</tt></a> is Qt::CustomContextMenu, and the user has requested a context menu on the widget. The position <tt>pos</tt> is the position of the context menu event that the widget receives. Normally this is in widget coordinates. The exception to this rule is <a href="QAbstractScrollArea.html"><tt>QAbstractScrollArea</tt></a> and its subclasses that map the context menu event to coordinates of the viewport()</tt> .</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.core.QPoint pos)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QWidget.html#mapToGlobal(com.trolltech.qt.core.QPoint)"><tt>mapToGlobal</tt></a>, <a href="QMenu.html"><tt>QMenu</tt></a>, <a href="QWidget.html#contextMenuPolicy()"><tt>contextMenuPolicy</tt></a></dd> </dl> */"/> <method name="public QTabBar(com.trolltech.qt.gui.QWidget parent)" doc="/** <p>Creates a new tab bar with the given <tt>parent</tt>.</p> */"/> <method name="public QTabBar()" doc="/** <p>Equivalent to <a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a>(0). */"/> <method name="public final int addTab(com.trolltech.qt.gui.QIcon icon, java.lang.String text)" doc="/** <p>Adds a new tab with icon <tt>icon</tt> and text <tt>text</tt>. Returns the new tab's index.</p> */"/> <method name="public final int addTab(java.lang.String text)" doc="/** <p>Adds a new tab with text <tt>text</tt>. Returns the new tab's index.</p> */"/> <method name="public final int count()" doc="/** <p>Returns the number of tabs in the tab bar.</p> */"/> <method name="public final int currentIndex()" doc="/** <p>Returns the index of the tab bar's visible tab.</p> @see <a href="QTabBar.html#setCurrentIndex(int)"><tt>setCurrentIndex</tt></a> */"/> <method name="public final boolean drawBase()" doc="/** <p>Returns defines whether or not tab bar should draw its base..</p> <p>If true then <a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a> draws a base in relation to the styles overlab. Otherwise only the tabs are drawn.</p> @see <a href="QTabBar.html#setDrawBase(boolean)"><tt>setDrawBase</tt></a> @see <tt>QStyle::pixelMetric</tt> @see <tt>QStyle::PM_TabBarBaseOverlap</tt> @see <a href="QStyleOptionTabBarBase.html"><tt>QStyleOptionTabBarBase</tt></a> */"/> <method name="public final com.trolltech.qt.core.Qt.TextElideMode elideMode()" doc="/** <p>Returns how to elide text in the tab bar.</p> <p>This property controls how items are elided when there is not enough space to show them for a given tab bar size.</p> <p>By default the value is style dependent.</p> @see <a href="QTabBar.html#setElideMode(com.trolltech.qt.core.Qt.TextElideMode)"><tt>setElideMode</tt></a> @see <tt>QTabWidget::elideMode</tt> @see <a href="QTabBar.html#usesScrollButtons()"><tt>usesScrollButtons</tt></a> @see <tt>QStyle::SH_TabBar_ElideMode</tt> */"/> <method name="public final com.trolltech.qt.core.QSize iconSize()" doc="/** <p>Returns The size for icons in the tab bar.</p> <p>The default value is style-dependent. <tt>iconSize</tt> is a maximum size; icons that are smaller are not scaled up.</p> @see <a href="QTabBar.html#setIconSize(com.trolltech.qt.core.QSize)"><tt>setIconSize</tt></a> @see <tt>QTabWidget::iconSize</tt> */"/> <method name="public final int insertTab(int index, com.trolltech.qt.gui.QIcon icon, java.lang.String text)" doc="/** <p>Inserts a new tab with icon <tt>icon</tt> and text <tt>text</tt> at position <tt>index</tt>. If <tt>index</tt> is out of range, the new tab is appended. Returns the new tab's index.</p> <p>If the <a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a> was empty before this function is called, the inserted tab becomes the current tab.</p> <p>Inserting a new tab at an index less than or equal to the current index will increment the current index, but keep the current tab.</p> */"/> <method name="public final int insertTab(int index, java.lang.String text)" doc="/** <p>Inserts a new tab with text <tt>text</tt> at position <tt>index</tt>. If <tt>index</tt> is out of range, the new tab is appened. Returns the new tab's index.</p> */"/> <method name="public final boolean isTabEnabled(int index)" doc="/** <p>Returns true if the tab at position <tt>index</tt> is enabled; otherwise returns false.</p> */"/> <method name="public final void removeTab(int index)" doc="/** <p>Removes the tab at position <tt>index</tt>.</p> */"/> <method name="public final void setCurrentIndex(int index)" doc="/** <p>Sets the index of the tab bar's visible tab to <tt>index</tt>.</p> @see <a href="QTabBar.html#currentIndex()"><tt>currentIndex</tt></a> */"/> <method name="public final void setDrawBase(boolean drawTheBase)" doc="/** <p>Sets defines whether or not tab bar should draw its base. to <tt>drawTheBase</tt>.</p> <p>If true then <a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a> draws a base in relation to the styles overlab. Otherwise only the tabs are drawn.</p> @see <a href="QTabBar.html#drawBase()"><tt>drawBase</tt></a> @see <tt>QStyle::pixelMetric</tt> @see <tt>QStyle::PM_TabBarBaseOverlap</tt> @see <a href="QStyleOptionTabBarBase.html"><tt>QStyleOptionTabBarBase</tt></a> */"/> <method name="public final void setElideMode(com.trolltech.qt.core.Qt.TextElideMode arg__1)" doc="/** <p>Sets how to elide text in the tab bar to <tt>arg__1</tt>.</p> <p>This property controls how items are elided when there is not enough space to show them for a given tab bar size.</p> <p>By default the value is style dependent.</p> @see <tt>QTabWidget::elideMode</tt> @see <a href="QTabBar.html#usesScrollButtons()"><tt>usesScrollButtons</tt></a> @see <tt>QStyle::SH_TabBar_ElideMode</tt> */"/> <method name="public final void setIconSize(com.trolltech.qt.core.QSize size)" doc="/** <p>Sets The size for icons in the tab bar to <tt>size</tt>.</p> <p>The default value is style-dependent. <tt>iconSize</tt> is a maximum size; icons that are smaller are not scaled up.</p> @see <tt>QTabWidget::iconSize</tt> */"/> <method name="public final void setShape(com.trolltech.qt.gui.QTabBar.Shape shape)" doc="/** <p>Sets the shape of the tabs in the tab bar to <tt>shape</tt>.</p> <p>Possible values for this property are described by the Shape enum.</p> @see <a href="QTabBar.html#shape()"><tt>shape</tt></a> */"/> <method name="public final void setTabData(int index, java.lang.Object data)" doc="/** <p>Sets the data of the tab at position <tt>index</tt> to <tt>data</tt>.</p> @see <a href="QTabBar.html#tabData(int)"><tt>tabData</tt></a> */"/> <method name="public final void setTabEnabled(int index, boolean arg__2)" doc="/** <p>If <tt>arg__2</tt> is true then the tab at position <tt>index</tt> is enabled; otherwise the item at position <tt>index</tt> is disabled.</p> @see <a href="QTabBar.html#isTabEnabled(int)"><tt>isTabEnabled</tt></a> */"/> <method name="public final void setTabIcon(int index, com.trolltech.qt.gui.QIcon icon)" doc="/** <p>Sets the icon of the tab at position <tt>index</tt> to <tt>icon</tt>.</p> @see <a href="QTabBar.html#tabIcon(int)"><tt>tabIcon</tt></a> */"/> <method name="public final void setTabText(int index, java.lang.String text)" doc="/** <p>Sets the text of the tab at position <tt>index</tt> to <tt>text</tt>.</p> @see <a href="QTabBar.html#tabText(int)"><tt>tabText</tt></a> */"/> <method name="public final void setTabTextColor(int index, com.trolltech.qt.gui.QColor color)" doc="/** <p>Sets the color of the text in the tab with the given <tt>index</tt> to the specified <tt>color</tt>.</p> <p>If an invalid color is specified, the tab will use the <a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a> foreground role instead.</p> @see <a href="QTabBar.html#tabTextColor(int)"><tt>tabTextColor</tt></a> */"/> <method name="public final void setTabToolTip(int index, java.lang.String tip)" doc="/** <p>Sets the tool tip of the tab at position <tt>index</tt> to <tt>tip</tt>.</p> @see <a href="QTabBar.html#tabToolTip(int)"><tt>tabToolTip</tt></a> */"/> <method name="public final void setTabWhatsThis(int index, java.lang.String text)" doc="/** <p>Sets the What's This help text of the tab at position <tt>index</tt> to <tt>text</tt>.</p> @see <a href="QTabBar.html#tabWhatsThis(int)"><tt>tabWhatsThis</tt></a> */"/> <method name="public final void setUsesScrollButtons(boolean useButtons)" doc="/** <p>Sets Whether or not a tab bar should use buttons to scroll tabs when it has many tabs. to <tt>useButtons</tt>.</p> <p>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.</p> <p>By default the value is style dependant.</p> @see <a href="QTabBar.html#elideMode()"><tt>elideMode</tt></a> @see <tt>QTabWidget::usesScrollButtons</tt> @see <tt>QStyle::SH_TabBar_PreferNoArrows</tt> */"/> <method name="public final com.trolltech.qt.gui.QTabBar.Shape shape()" doc="/** <p>Returns the shape of the tabs in the tab bar.</p> <p>Possible values for this property are described by the Shape enum.</p> @see <a href="QTabBar.html#setShape(com.trolltech.qt.gui.QTabBar.Shape)"><tt>setShape</tt></a> */"/> <method name="public final int tabAt(com.trolltech.qt.core.QPoint pos)" doc="/** <p>Returns the index of the tab that covers <tt>pos</tt> or -1 if no tab covers <tt>pos</tt>;</p> */"/> <method name="public final java.lang.Object tabData(int index)" doc="/** <p>Returns the datad of the tab at position <tt>index</tt>, or a null variant if <tt>index</tt> is out of range.</p> @see <a href="QTabBar.html#setTabData(int, java.lang.Object)"><tt>setTabData</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QIcon tabIcon(int index)" doc="/** <p>Returns the icon of the tab at position <tt>index</tt>, or a null icon if <tt>index</tt> is out of range.</p> @see <a href="QTabBar.html#setTabIcon(int, com.trolltech.qt.gui.QIcon)"><tt>setTabIcon</tt></a> */"/> <method name="public final com.trolltech.qt.core.QRect tabRect(int index)" doc="/** <p>Returns the visual rectangle of the of the tab at position <tt>index</tt>, or a null rectangle if <tt>index</tt> is out of range.</p> */"/> <method name="public final java.lang.String tabText(int index)" doc="/** <p>Returns the text of the tab at position <tt>index</tt>, or an empty string if <tt>index</tt> is out of range.</p> @see <a href="QTabBar.html#setTabText(int, java.lang.String)"><tt>setTabText</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QColor tabTextColor(int index)" doc="/** <p>Returns the text color of the tab with the given <tt>index</tt>, or a invalid color if <tt>index</tt> is out of range.</p> @see <a href="QTabBar.html#setTabTextColor(int, com.trolltech.qt.gui.QColor)"><tt>setTabTextColor</tt></a> */"/> <method name="public final java.lang.String tabToolTip(int index)" doc="/** <p>Returns the tool tip of the tab at position <tt>index</tt>, or an empty string if <tt>index</tt> is out of range.</p> @see <a href="QTabBar.html#setTabToolTip(int, java.lang.String)"><tt>setTabToolTip</tt></a> */"/> <method name="public final java.lang.String tabWhatsThis(int index)" doc="/** <p>Returns the What's This help text of the tab at position <tt>index</tt>, or an empty string if <tt>index</tt> is out of range.</p> @see <a href="QTabBar.html#setTabWhatsThis(int, java.lang.String)"><tt>setTabWhatsThis</tt></a> */"/> <method name="public final boolean usesScrollButtons()" doc="/** <p>Returns Whether or not a tab bar should use buttons to scroll tabs when it has many tabs..</p> <p>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.</p> <p>By default the value is style dependant.</p> @see <a href="QTabBar.html#setUsesScrollButtons(boolean)"><tt>setUsesScrollButtons</tt></a> @see <a href="QTabBar.html#elideMode()"><tt>elideMode</tt></a> @see <tt>QTabWidget::usesScrollButtons</tt> @see <tt>QStyle::SH_TabBar_PreferNoArrows</tt> */"/> <method name="protected void changeEvent(com.trolltech.qt.core.QEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public boolean event(com.trolltech.qt.core.QEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void keyPressEvent(com.trolltech.qt.gui.QKeyEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public com.trolltech.qt.core.QSize minimumSizeHint()" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void mouseMoveEvent(com.trolltech.qt.gui.QMouseEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void mousePressEvent(com.trolltech.qt.gui.QMouseEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void mouseReleaseEvent(com.trolltech.qt.gui.QMouseEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void paintEvent(com.trolltech.qt.gui.QPaintEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void resizeEvent(com.trolltech.qt.gui.QResizeEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void showEvent(com.trolltech.qt.gui.QShowEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public com.trolltech.qt.core.QSize sizeHint()" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void tabInserted(int index)" doc="/** <p>This virtual handler is called after a new tab was added or inserted at position <tt>index</tt>.</p> @see <a href="QTabBar.html#tabRemoved(int)"><tt>tabRemoved</tt></a> */"/> <method name="protected void tabLayoutChange()" doc="/** <p>This virtual handler is called whenever the tab layout changes.</p> @see <a href="QTabBar.html#tabRect(int)"><tt>tabRect</tt></a> */"/> <method name="protected void tabRemoved(int index)" doc="/** <p>This virtual handler is called after a tab was removed from position <tt>index</tt>.</p> @see <a href="QTabBar.html#tabInserted(int)"><tt>tabInserted</tt></a> */"/> <method name="protected com.trolltech.qt.core.QSize tabSizeHint(int index)" doc="/** <p>Returns the size hint for the tab at position <tt>index</tt>.</p> */"/> <enum name="Shape" doc="/** <p>This enum type lists the built-in shapes supported by <a href="QTabBar.html#QTabBar(com.trolltech.qt.gui.QWidget)"><tt>QTabBar</tt></a>. Treat these as hints as some styles may not render some of the shapes. However, position should be honored.</p> */"> <enum-value name="RoundedNorth" doc="/** <p>The normal rounded look above the pages</p> */"/> <enum-value name="RoundedSouth" doc="/** <p>The normal rounded look below the pages</p> */"/> <enum-value name="RoundedWest" doc="/** <p>The normal rounded look on the left side of the pages</p> */"/> <enum-value name="RoundedEast" doc="/** <p>The normal rounded look on the right side the pages</p> */"/> <enum-value name="TriangularNorth" doc="/** <p>Triangular tabs above the pages.</p> */"/> <enum-value name="TriangularSouth" doc="/** <p>Triangular tabs similar to those used in the Excel spreadsheet, for example</p> */"/> <enum-value name="TriangularWest" doc="/** <p>Triangular tabs on the left of the pages.</p> */"/> <enum-value name="TriangularEast" doc="/** <p>Triangular tabs on the right of the pages.</p> */"/> </enum> </class>