• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kdeui

KTabWidget Class Reference

A widget containing multiple tabs. More...

#include <ktabwidget.h>

Inheritance diagram for KTabWidget:

Inheritance graph
[legend]

List of all members.


Public Slots

virtual void moveTab (int, int)
virtual void removePage (QWidget *w)
void setAutomaticResizeTabs (bool enable)
void setHoverCloseButton (bool enable)
void setHoverCloseButtonDelayed (bool delayed)
void setTabCloseActivatePrevious (bool previous)
void setTabReorderingEnabled (bool enable)

Signals

void closeRequest (QWidget *)
void contextMenu (QWidget *, const QPoint &)
void contextMenu (const QPoint &)
void initiateDrag (QWidget *)
void mouseDoubleClick (QWidget *)
void mouseDoubleClick ()
void mouseMiddleClick (QWidget *)
void mouseMiddleClick ()
void movedTab (int, int)
void receivedDropEvent (QWidget *, QDropEvent *)
void receivedDropEvent (QDropEvent *)
void testCanDecode (const QDragMoveEvent *e, bool &accept)

Public Member Functions

bool automaticResizeTabs () const
void changeTab (QWidget *child, const QIconSet &iconset, const QString &label)
void changeTab (QWidget *, const QString &)
bool hoverCloseButton () const
bool hoverCloseButtonDelayed () const
virtual void insertTab (QWidget *, QTab *, int index=-1)
virtual void insertTab (QWidget *child, const QIconSet &iconset, const QString &label, int index=-1)
virtual void insertTab (QWidget *, const QString &, int index=-1)
bool isTabBarHidden () const
bool isTabReorderingEnabled () const
 KTabWidget (QWidget *parent=0, const char *name=0, WFlags f=0)
QString label (int) const
void setTabBarHidden (bool hide)
void setTabColor (QWidget *, const QColor &color)
void setTabLabel (QWidget *, const QString &)
bool tabCloseActivatePrevious () const
QColor tabColor (QWidget *) const
QString tabLabel (QWidget *) const
virtual ~KTabWidget ()

Protected Slots

virtual void closeRequest (int)
virtual void contextMenu (int, const QPoint &)
virtual void initiateDrag (int)
virtual void mouseDoubleClick (int)
virtual void mouseMiddleClick (int)
virtual void receivedDropEvent (int, QDropEvent *)
virtual void wheelDelta (int)

Protected Member Functions

virtual void dragMoveEvent (QDragMoveEvent *)
virtual void dropEvent (QDropEvent *)
virtual void mouseDoubleClickEvent (QMouseEvent *e)
virtual void mousePressEvent (QMouseEvent *)
virtual void resizeEvent (QResizeEvent *)
unsigned int tabBarWidthForMaxChars (uint maxLength)
virtual void wheelEvent (QWheelEvent *e)

Properties

bool automaticResizeTabs
bool hoverCloseButton
bool hoverCloseButtonDelayed
bool tabCloseActivatePrevious
bool tabReorderingEnabled

Detailed Description

A widget containing multiple tabs.

Since:
3.2

Definition at line 36 of file ktabwidget.h.


Constructor & Destructor Documentation

KTabWidget::KTabWidget ( QWidget *  parent = 0,
const char *  name = 0,
WFlags  f = 0 
)

Definition at line 52 of file ktabwidget.cpp.

KTabWidget::~KTabWidget (  )  [virtual]

Destructor.

Definition at line 72 of file ktabwidget.cpp.


Member Function Documentation

bool KTabWidget::automaticResizeTabs (  )  const

Returns true if calling setTitle() will resize tabs to the width of the tab bar.

Since:
3.4

void KTabWidget::changeTab ( QWidget *  child,
const QIconSet &  iconset,
const QString &  label 
)

Reimplemented for internal reasons.

Reimplemented from QTabWidget.

Definition at line 197 of file ktabwidget.cpp.

void KTabWidget::changeTab ( QWidget *  w,
const QString &  label 
)

Reimplemented for internal reasons.

Reimplemented from QTabWidget.

Definition at line 185 of file ktabwidget.cpp.

void KTabWidget::closeRequest ( int  index  )  [protected, virtual, slot]

Definition at line 513 of file ktabwidget.cpp.

void KTabWidget::closeRequest ( QWidget *   )  [signal]

The close button of a widget's tab was clicked. This signal is only possible after you have called setHoverCloseButton( true ).

void KTabWidget::contextMenu ( int  index,
const QPoint &  p 
) [protected, virtual, slot]

Definition at line 388 of file ktabwidget.cpp.

void KTabWidget::contextMenu ( QWidget *  ,
const QPoint &   
) [signal]

The right mouse button was pressed over a widget.

void KTabWidget::contextMenu ( const QPoint &   )  [signal]

The right mouse button was pressed over empty space besides tabbar.

void KTabWidget::dragMoveEvent ( QDragMoveEvent *  e  )  [protected, virtual]

Definition at line 298 of file ktabwidget.cpp.

void KTabWidget::dropEvent ( QDropEvent *  e  )  [protected, virtual]

Definition at line 312 of file ktabwidget.cpp.

bool KTabWidget::hoverCloseButton (  )  const

Returns true if the close button is shown on tabs when mouse is hovering over them.

bool KTabWidget::hoverCloseButtonDelayed (  )  const

Returns true if the close button is shown on tabs after a delay.

void KTabWidget::initiateDrag ( int  index  )  [protected, virtual, slot]

Definition at line 383 of file ktabwidget.cpp.

void KTabWidget::initiateDrag ( QWidget *   )  [signal]

Request to start a drag operation on the given tab.

void KTabWidget::insertTab ( QWidget *  child,
QTab *  tab,
int  index = -1 
) [virtual]

Reimplemented for internal reasons.

Reimplemented from QTabWidget.

Definition at line 87 of file ktabwidget.cpp.

void KTabWidget::insertTab ( QWidget *  child,
const QIconSet &  iconset,
const QString &  label,
int  index = -1 
) [virtual]

Reimplemented for internal reasons.

Reimplemented from QTabWidget.

Definition at line 82 of file ktabwidget.cpp.

void KTabWidget::insertTab ( QWidget *  child,
const QString &  label,
int  index = -1 
) [virtual]

Reimplemented for internal reasons.

Reimplemented from QTabWidget.

Definition at line 77 of file ktabwidget.cpp.

bool KTabWidget::isTabBarHidden (  )  const

Returns true if the tabbar is hidden.

Since:
3.4

Definition at line 118 of file ktabwidget.cpp.

bool KTabWidget::isTabReorderingEnabled (  )  const

Returns true if tab ordering with the middle mouse button has been enabled.

Definition at line 146 of file ktabwidget.cpp.

QString KTabWidget::label ( int  index  )  const

Reimplemented for internal reasons.

Reimplemented from QTabWidget.

Definition at line 209 of file ktabwidget.cpp.

void KTabWidget::mouseDoubleClick ( int  index  )  [protected, virtual, slot]

Definition at line 393 of file ktabwidget.cpp.

void KTabWidget::mouseDoubleClick ( QWidget *   )  [signal]

A double left mouse button click was performed over the widget.

void KTabWidget::mouseDoubleClick (  )  [signal]

A double left mouse button click was performed over empty space besides tabbar.

Since:
3.3

void KTabWidget::mouseDoubleClickEvent ( QMouseEvent *  e  )  [protected, virtual]

Definition at line 350 of file ktabwidget.cpp.

void KTabWidget::mouseMiddleClick ( int  index  )  [protected, virtual, slot]

Definition at line 398 of file ktabwidget.cpp.

void KTabWidget::mouseMiddleClick ( QWidget *   )  [signal]

A middle mouse button click was performed over the widget.

void KTabWidget::mouseMiddleClick (  )  [signal]

A middle mouse button click was performed over empty space besides tabbar.

void KTabWidget::mousePressEvent ( QMouseEvent *  e  )  [protected, virtual]

Definition at line 362 of file ktabwidget.cpp.

void KTabWidget::movedTab ( int  ,
int   
) [signal]

A tab was moved from first to second index. This signal is only possible after you have called setTabReorderingEnabled( true ).

void KTabWidget::moveTab ( int  from,
int  to 
) [virtual, slot]

Move a widget's tab from first to second specified index and emit signal movedTab( int, int ) afterwards.

Definition at line 403 of file ktabwidget.cpp.

void KTabWidget::receivedDropEvent ( int  index,
QDropEvent *  e 
) [protected, virtual, slot]

Definition at line 378 of file ktabwidget.cpp.

void KTabWidget::receivedDropEvent ( QWidget *  ,
QDropEvent *   
) [signal]

Received an drop event on given widget's tab. This signal is only possible after testCanDecode and positive accept result.

void KTabWidget::receivedDropEvent ( QDropEvent *   )  [signal]

Received an event in the empty space beside tabbar. Usually creates a new tab. This signal is only possible after testCanDecode and positive accept result.

void KTabWidget::removePage ( QWidget *  w  )  [virtual, slot]

Removes the widget, reimplemented for internal reasons (keeping labels in sync).

Reimplemented from QTabWidget.

Definition at line 438 of file ktabwidget.cpp.

void KTabWidget::resizeEvent ( QResizeEvent *  e  )  [protected, virtual]

Definition at line 518 of file ktabwidget.cpp.

void KTabWidget::setAutomaticResizeTabs ( bool  enable  )  [slot]

If enable is true, tabs will be resized to the width of the tab bar.

Does not work reliable with "QTabWidget* foo=new KTabWidget()" and if you change tabs via the tabbar or by accessing tabs directly.

Since:
3.4

Definition at line 491 of file ktabwidget.cpp.

void KTabWidget::setHoverCloseButton ( bool  enable  )  [slot]

If enable is true, a close button will be shown on mouse hover over tab icons which will emit signal closeRequest( QWidget * ) when pressed.

Definition at line 471 of file ktabwidget.cpp.

void KTabWidget::setHoverCloseButtonDelayed ( bool  delayed  )  [slot]

If delayed is true, a close button will be shown on mouse hover over tab icons after mouse double click delay else immediately.

Definition at line 481 of file ktabwidget.cpp.

void KTabWidget::setTabBarHidden ( bool  hide  ) 

If hide is true, the tabbar is hidden along with any corner widgets.

Since:
3.4

Definition at line 102 of file ktabwidget.cpp.

void KTabWidget::setTabCloseActivatePrevious ( bool  previous  )  [slot]

If previous is true, closing the current tab activates the previous active tab instead of the one to the right.

Since:
3.3

Definition at line 151 of file ktabwidget.cpp.

void KTabWidget::setTabColor ( QWidget *  w,
const QColor &  color 
)

Set the tab of the given widget to color.

Definition at line 123 of file ktabwidget.cpp.

void KTabWidget::setTabLabel ( QWidget *  w,
const QString &  l 
)

Reimplemented for internal reasons.

Reimplemented from QTabWidget.

Definition at line 234 of file ktabwidget.cpp.

void KTabWidget::setTabReorderingEnabled ( bool  enable  )  [slot]

If enable is true, tab reordering with middle button will be enabled.

Note that once enabled you shouldn't rely on previously queried currentPageIndex() or indexOf( QWidget * ) values anymore.

You can connect to signal movedTab(int, int) which will notify you from which index to which index a tab has been moved.

Definition at line 141 of file ktabwidget.cpp.

unsigned int KTabWidget::tabBarWidthForMaxChars ( uint  maxLength  )  [protected]

Definition at line 161 of file ktabwidget.cpp.

bool KTabWidget::tabCloseActivatePrevious (  )  const

Returns true if closing the current tab activates the previous actice tab instead of the one to the right.

Since:
3.3

QColor KTabWidget::tabColor ( QWidget *  w  )  const

Returns the tab color for the given widget.

Definition at line 131 of file ktabwidget.cpp.

QString KTabWidget::tabLabel ( QWidget *  w  )  const

Reimplemented for internal reasons.

Reimplemented from QTabWidget.

Definition at line 221 of file ktabwidget.cpp.

void KTabWidget::testCanDecode ( const QDragMoveEvent *  e,
bool &  accept 
) [signal]

Connect to this and set accept to true if you can and want to decode the event.

void KTabWidget::wheelDelta ( int  delta  )  [protected, virtual, slot]

Definition at line 333 of file ktabwidget.cpp.

void KTabWidget::wheelEvent ( QWheelEvent *  e  )  [protected, virtual]

Definition at line 322 of file ktabwidget.cpp.


Property Documentation

bool KTabWidget::automaticResizeTabs [read, write]

Definition at line 43 of file ktabwidget.h.

bool KTabWidget::hoverCloseButton [read, write]

Definition at line 40 of file ktabwidget.h.

bool KTabWidget::hoverCloseButtonDelayed [read, write]

Definition at line 41 of file ktabwidget.h.

bool KTabWidget::tabCloseActivatePrevious [read, write]

Definition at line 42 of file ktabwidget.h.

bool KTabWidget::tabReorderingEnabled [read, write]

Definition at line 39 of file ktabwidget.h.


The documentation for this class was generated from the following files:
  • ktabwidget.h
  • ktabwidget.cpp

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal