class KDockTabCtl

A manager for a single KDockTabBar (and member of the dockwidget class set). More...

Definition#include <kdocktabctl.h>
InheritsQWidget (kdecore)
Inherited byKDockTabGroup
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Slots

Signals

Protected Methods

Protected Slots

Protected Members


Detailed Description

A manager for a single KDockTabBar (and member of the dockwidget class set). The KDockWidget class ever use this class instead of accessing the KDockTabBar directly.

For some reasons it's more practical for the Dockwidget class set than QTabBar or KTabBar .

 KDockTabCtl ( QWidget *parent = 0, const char *name = 0 )

Constructs a dock-tab control object.

KDockTabCtl ()

Destructs this.

void  setTabPos ( KDockTabBar::TabPos )

Calls KDockTabBar::setTabPos of its embedded tab bar but does layout actions, additionally.

KDockTabBar::TabPos  getTabPos ()

Returns the current tab position of its docktabbar.

int  insertPage ( QWidget * w, const QString &label, int id = -1 )

Inserts a new tab page in the encapsulated docktabbar. Mainly it calls KDockTabBar::insertTab and does additional management operations.

Parameters:
wthe widget that is inserted
labelthe title for the caption bar of the tab page

Returns: the id of the new inserted page

void  setPageCaption ( QWidget* w, const QString &s )

Sets the title of the tab page. Mainly it calls KDockTabBar::setPageCaption but calls it internally by the page id.

Parameters:
wthe widget we want to give a new caption
swell, what the heck could that be? ;-)

void  setPageCaption ( int id, const QString &caption )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

QString  pageCaption ( QWidget* w)

Returns the title of the tab page. Mainly it calls KDockTabBar::setPageCaption but calls it internally by the page id.

Parameters:
wthe widget for that we want to know its caption

Returns: a string containing the title of the page

QString  pageCaption ( int id )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void  setPixmap ( QWidget* w, const QPixmap &pix )

Sets an icon for the tab page (shown in the tab header).

Parameters:
wthe widget we want to give a new icon
pixthe new icon

void  setPixmap ( int id, const QPixmap &pix )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void  setToolTip ( QWidget* w, const QString &toolTipStr )

Sets a toolTip for the tab page (shown in the tab header).

Parameters:
wthe widget we want to give the tooltip
toolTipStrthe new tooltip string

void  setTabTextColor ( QWidget*, const QColor &color )

Sets the text colour of the tab page. Mainly it calls KDockTabBar::setTextColor but calls it internally by the page id.

Parameters:
wthe widget we want to give a new text colour
colorthe colour of the tab header

void  setTabTextColor ( int id, const QColor &color )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

const QColor&  tabTextColor ( QWidget* w)

Returns the text colour of the tab page. Mainly it calls KDockTabBar::textColor but calls it internally by the page id.

Parameters:
wthe widget we want to ask for its text colour

const QColor&  tabTextColor ( int id )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

bool  isPageEnabled ( QWidget* w)

Returns if the tab page is enabled (if it can get the focus).

Parameters:
wthe widget we want to ask if its page is enabled

bool  isPageEnabled ( int id )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void  setPageEnabled ( QWidget* w, bool e)

Enable or disable the tab page (whether it can get the focus or not). Mainly it calls KDockTabBar::setPageEnabled but calls it internally by the page id.

Parameters:
wthe widget that should be enabled
eboolean value whether enabled or disabled

void  setPageEnabled ( int id, bool enabled )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

QWidget*  page ( int id)

/

/** Returns the widget that embedded in a page.

Parameters:
idthe identification number of the page

int  id ( QWidget* w)

Returns the widget's Id.

Parameters:
wthe widget that should return its id

void  removePage ( QWidget* w)

Removes the tab page from the covered tab bar. Mainly it calls KDockTabBar::removeTab but calls it internally by the page id.

Parameters:
wthe tab page that should be removed

void  removePage ( int id )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

QWidget*  visiblePage ()

Returns the current (visible) tab page.

int  visiblePageId ()

Returns the id of the current (visible) tab page.

void  setVisiblePage ( QWidget*, bool allowDisable = false )

Sets the given tab page as the active (and visible) one.

void  setTabFont ( const QFont &font )

Sets the font for the tab pages. It just calls the appropriate method of its KDockTabBar.

QFont  tabFont ()

Returns the font for the tab pages. It simply calls KDockTabBar::tabFont .

void  showTabIcon ( bool )

Enables or disables the showing of the icons for every tab page. It simply calls KDockTabBar::showTabIcon .

bool  isShowTabIcon ()

Returns if the tab icon is shown. It simply calls KDockTabBar::isShowTabIcon .

int  pageCount ()

Returns the number of inserted tab pages.

QWidget*  getFirstPage ()

Returns the first tab page in its KDockTabBar.

QWidget*  getLastPage ()

Returns the last tab page in its KDockTabBar.

QWidget*  getNextPage ( QWidget* )

Returns the tab page that is at the right side of the given tab widget.

QWidget*  getPrevPage ( QWidget* )

Returns the tab page that is at the left side of the given tab widget.

void  show ()

[virtual]

Shows its encapsulated tab bar and shows the current tab page.

bool  eventFilter ( QObject*, QEvent* )

[virtual]

Catches some events that are of interest for this class.

void  setEnabled ( bool )

[virtual slot]

Enables or disables this and its KDockTabBar.

void  setVisiblePage (int id)

[slot]

Sets the visible page by its id.

void  paintEvent (QPaintEvent *)

[protected]

Handles paint events for this widgets Reimplemented from QWidget

void  aboutToShow ( QWidget* )

[signal]

Signals that the given widget is about to show.

void  pageSelected ( QWidget* )

[signal]

Signals that that tab page is selected.

void  tabShowPopup ( int, QPoint )

[signal]

Signals that the right mouse button is pressed on this.

void  rightButtonPress ( int, QPoint )

[protected slot]

Do some things that should be done when someone has pressed the right mouse button on this.

KDockTabCtl_Private*  findData ( QWidget* )

[protected]

Returns the appropriate data for the widget from the parameter list.

KDockTabCtl_Private*  findData ( int id )

[protected]

Returns the appropriate data for the widget from the parameter list described by its id.

void  showPage ( QWidget*, bool allowDisable = false )

[protected]

Shows the tab page.

QWidgetStack* stack

[protected]

a data structure that contains all embedded widgets.

QBoxLayout* layout

[protected]

The layout manager for automatic positioning and resizing of the embedded tab pages.

QBoxLayout* stack_layout

[protected]

The layout manager for the widget stack.

QList<KDockTabCtl_Private> * mainData

[protected]

An internal list for managing the tab pages. It stores data items for every tab page in the tab bar. An data item is of type KDockTabCtl_Private (a struct) that contains the widget, its id and information about whether it is enabled or disabled.

QWidget* currentPage

[protected]

A pointer to the widget that is the current tab page in the covered tab bar.

KDockTabBar* tabs

[protected]

The actual tab bar widget that is encapsulated by this control class. Often this manager puts only method calls through and does some additional management functions.

KDockTabBar::TabPos tabPos

[protected]

The current tab position.