|
|
KitTabBar is a full function Tabbar similar to QTabBar but has additional functionality. Additional features include side tabs, tab sizing, context menu support, and QWhatsThis support.
enum Position { Left, Right, Top, Bottom } | Position |
The position of the tab bar
enum TabShape { Rounded, Triangular } | TabShape |
The shape of the tabs
enum TabSize { Normal, Thin } | TabSize |
The size of the tabs
KitTabBar ( KitTabBar::Position pos = KitTabBar::Top, QWidget * parent = 0, const char * name = 0 )
| KitTabBar |
Constructor
~KitTabBar ()
| ~KitTabBar |
Destructor
int addTab ( const QString & text )
| addTab |
Adds a tab to the bar.
Parameters:
text | the text of the tab |
Returns: the id of the tab
int addTab ( const QIconSet & icon, const QString & text = QString::null )
| addTab |
Same as above but with an icon.
Parameters:
icon | the icon of the tab |
text | the text of the tab |
Returns: the id of the tab
int insertTab ( const QString & text, int index = -1 )
| insertTab |
Adds a tab to the bar at the index specified.
Parameters:
text | the text of the tab |
index | the index of the tab placement |
Returns: the id of the tab
int insertTab ( const QIconSet & icon, const QString & text = QString::null, int index = -1 )
| insertTab |
Same as above but with an icon.
Parameters:
icon | the icon of the tab |
text | the text of the tab |
index | the index of the tab placement |
Returns: the id of the tab
int insertTab ( QTab * tab, int index = -1 )
| insertTab |
Same as above but with a pointer to an existing tab. The tab may or may not already have an icon and text.
Parameters:
tab | the pointer to the tab |
index | the index of the tab placement |
Returns: the id of the tab
void removeTab ( int id )
| removeTab |
Removes the tab from the bar. If the tab is the currently selected tab the next available tab is set as selected.
Parameters:
id | the id of the tab |
void removeTab ( QTab * tab )
| removeTab |
Same as above
Parameters:
tab | the pointer to the tab |
int currentTab ()
| currentTab |
Returns: the id of the currently selected tab
void setCurrentTab ( int id )
| setCurrentTab |
Sets the tab with id as selected
Parameters:
id | the id of the tab |
void setCurrentTab ( QTab * tab )
| setCurrentTab |
Same as above
Parameters:
tab | the pointer to the tab |
void setTabEnabled ( int id, bool enabled )
| setTabEnabled |
Set a tab as enabled or disabled. Use this method instead of using the tab pointer. Using the tab pointer directly has unpredictable results. Disabling the currently selected tab causes the next available enabled tab to be set as selected.
Parameters:
id | the id of the tab |
enabled | toggle the tab as enabled/disabled |
void setTabEnabled ( QTab * tab, bool enabled )
| setTabEnabled |
Same as above
Parameters:
tab | the pointer to the tab |
enabled | toggle the tab as enabled/disabled |
void setTabIconSet ( int id, const QIconSet & icon )
| setTabIconSet |
Sets the tab icon
Parameters:
id | the id of the tab |
icon | the iconset for the tab icon |
void setTabLabel ( int id, const QString & text )
| setTabLabel |
Sets the tab label
Parameters:
id | the id of the tab |
text | the text for the tab label |
KitTabBar::Position position ()
| position |
Returns: the current bar position
void setPosition ( KitTabBar::Position pos )
| setPosition |
Sets the tab bar position (Left, Right, Top, Bottom)
Parameters:
pos | the position of the tab bar |
Qt::Orientation orientation ()
| orientation |
Returns: the bar orientation ( Horizontal or Vertical )
void setActionMenu ( KActionMenu * menu )
| setActionMenu |
Sets the menu for a right click on the tab. This menu superceeds the popup menu if set.
Parameters:
menu | KActionMenu pointer |
void setPopupMenu ( KPopupMenu * menu )
| setPopupMenu |
Sets the menu for a right click on the tab. This menu is superceeded by the action menu if set.
Parameters:
menu | KPopupMenu pointer |
QTab * menuTab ()
| menuTab |
Use this to identify the tab that was right clicked.
Returns: the pointer to the tab that was right clicked
bool allowToggle ()
| allowToggle |
Returns: the current toggle mode
void setAllowToggle ( bool toggle )
| setAllowToggle |
Sets the tab toggle mode. You can unselect a tab if set to true. Toggling is off by default.
Parameters:
toggle | allows tab toggling |
bool autoSelect ()
| autoSelect |
Returns: the current auto-select mode
void setAutoSelect ( bool select )
| setAutoSelect |
Sets the auto-select mode. This will disable automatic selection of tabs when the currently selected tab is removed or disabled. Auto-select is on by default.
Parameters:
auto | the auto-select mode |
KitTabBar::TabShape tabShape ()
| tabShape |
[const]
Returns: the shape of the tabs
void setTabShape ( TabShape shape )
| setTabShape |
Sets the shape of the tabs
Parameters:
tab | shape |
KitTabBar::TabSize tabSize ()
| tabSize |
[const]
Returns: the size of the tabs
void setTabSize ( TabSize size )
| setTabSize |
Sets the size of the tabs
Parameters:
size | tab size |
QTab * tab ( int id )
| tab |
[const]
Parameters:
id | the id of the tab |
Returns: a pointer to the tab
const QString toolTip ( int id )
| toolTip |
Parameters:
id | the id of the tab |
Returns: the tooltip text for the tab
const QString toolTip ( QTab * tab )
| toolTip |
Parameters:
tab | the pointer to the tab |
Returns: the tooltip text for the tab
void setToolTip ( int id, const QString & tip )
| setToolTip |
Sets the text for the tab tooltip.
Parameters:
id | the id of the tab |
tip | the tooltip text for the tab |
void setToolTip ( QTab * tab, const QString & tip )
| setToolTip |
Sets the text for the tab tooltip.
Parameters:
tab | the pointer to the tab |
tip | the tooltip text for the tab |
void removeToolTip ( int id )
| removeToolTip |
Removes the tooltip from the tab.
Parameters:
id | the id of the tab |
void removeToolTip ( QTab * tab )
| removeToolTip |
Removes the tooltip from the tab.
Parameters:
tab | the pointer to the tab |
const QString whatsThis ( int id )
| whatsThis |
Parameters:
id | the id of the tab |
Returns: the 'whats this' text for the tab
const QString whatsThis ( QTab * tab )
| whatsThis |
Parameters:
tab | the pointer to the tab |
Returns: the 'whats this' text for the tab
void setWhatsThis ( int id, const QString & text )
| setWhatsThis |
Sets the 'whats this' text for the tab.
Parameters:
id | the id of the tab |
text | the 'whats this' text for the tab |
void setWhatsThis ( QTab * tab, const QString & text )
| setWhatsThis |
Sets the 'whats this' text for the tab.
Parameters:
tab | the pointer to the tab |
text | the 'whats this' text for the tab |
void removeWhatsThis ( int id )
| removeWhatsThis |
Removes the 'whats this' from the tab.
Parameters:
id | the id of the tab |
void removeWhatsThis ( QTab * tab )
| removeWhatsThis |
Removes the 'whats this' from the tab.
Parameters:
tab | the pointer to the tab |
int count ()
| count |
Returns: the number of tabs in the bar
const QPtrList<QTab> * tabList ()
| tabList |
Returns: the pointer list of tabs in the bar
void selected ( int id )
| selected |
[signal]
This is emitted only when the tab is first selected, not when toggled off.
Returns: the id of the tab selected
void toggled ( int id, bool selected )
| toggled |
[signal]
Returns: the tab id and the selection status
void rmbClicked ( int id )
| rmbClicked |
[signal]
This is emitted previous to the menu popup. Use this for custom right click processing. Menu's will popup only if set.
Returns: the id of the tab that was right clicked.
void rmbClicked ( QTab * tab )
| rmbClicked |
[signal]
Same as above but provides the tab pointer.
Returns: the pointer to the tab that was right clicked.
QSize sizeHint ()
| sizeHint |
[protected const]
QSize minimumSizeHint ()
| minimumSizeHint |
[protected const]
void fontChange ( const QFont & )
| fontChange |
[protected]
Reimplemented from QWidget.
void paintEvent ( QPaintEvent * )
| paintEvent |
[protected]
void resizeEvent ( QResizeEvent * )
| resizeEvent |
[protected]
void styleChange ( QStyle & )
| styleChange |
[protected]
Reimplemented from QWidget.