• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • widgets
ktabwidget.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2003 Stephan Binner <binner@kde.org>
3 Copyright (C) 2003 Zack Rusin <zack@kde.org>
4 Copyright (C) 2009 Urs Wolfer <uwolfer @ kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KTABWIDGET_H
23#define KTABWIDGET_H
24
25#include <kdeui_export.h>
26
27#include <QtGui/QTabWidget>
28
29class QTab;
30
44class KDEUI_EXPORT KTabWidget : public QTabWidget //krazy:exclude=qclasses
45{
46 Q_OBJECT
47#ifndef KDE_NO_DEPRECATED
48 Q_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
49 Q_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
50 Q_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
51 Q_PROPERTY( bool closeButtonEnabled READ isCloseButtonEnabled WRITE setCloseButtonEnabled )
52 Q_PROPERTY( bool tabCloseActivatePrevious READ tabCloseActivatePrevious WRITE setTabCloseActivatePrevious )
53#endif
54 Q_PROPERTY( bool automaticResizeTabs READ automaticResizeTabs WRITE setAutomaticResizeTabs )
55
56 public:
57
64 explicit KTabWidget( QWidget *parent = 0, Qt::WindowFlags flags = 0 );
65
69 virtual ~KTabWidget();
70
75 void setTabTextColor( int index, const QColor& color );
76
81 QColor tabTextColor( int index ) const;
82
89#ifndef KDE_NO_DEPRECATED
90 KDE_DEPRECATED bool isTabReorderingEnabled() const;
91#endif
92
99#ifndef KDE_NO_DEPRECATED
100 KDE_DEPRECATED bool hoverCloseButton() const;
101#endif
102
109#ifndef KDE_NO_DEPRECATED
110 KDE_DEPRECATED bool hoverCloseButtonDelayed() const;
111#endif
112
120#ifndef KDE_NO_DEPRECATED
121 KDE_DEPRECATED bool isCloseButtonEnabled() const;
122#endif
123
130#ifndef KDE_NO_DEPRECATED
131 KDE_DEPRECATED bool tabCloseActivatePrevious() const;
132#endif
133
138 bool automaticResizeTabs() const;
139
144 void setTabBarHidden( bool hide );
145
151 bool isTabBarHidden() const;
152
171 QString tabText( int ) const; // but it's not virtual...
172
173#ifdef KDE3_SUPPORT
177#ifndef KDE_NO_DEPRECATED
178 inline KDE_DEPRECATED QString label( int index ) const { return tabText( index ); }
179#endif
180
184#ifndef KDE_NO_DEPRECATED
185 inline KDE_DEPRECATED QString tabLabel( QWidget *w ) const { return tabText( indexOf( w ) ); }
186#endif
187
191#ifndef KDE_NO_DEPRECATED
192 inline KDE_DEPRECATED void setTabLabel( QWidget *w, const QString &l ) { setTabText( indexOf( w ),l ); }
193#endif
194#endif
195
199 void setTabText( int , const QString & );
200
201 using QTabWidget::tabBar;
202
203 public Q_SLOTS:
208 virtual void moveTab( int, int );
209
215 virtual QT_MOC_COMPAT void removePage ( QWidget * w );
216
221 virtual void removeTab(int index); // but it's not virtual in QTabWidget...
222
238#ifndef KDE_NO_DEPRECATED
239 QT_MOC_COMPAT void setTabReorderingEnabled( bool enable );
240#endif
241
249#ifndef KDE_NO_DEPRECATED
250 QT_MOC_COMPAT void setHoverCloseButton( bool enable );
251#endif
252
259#ifndef KDE_NO_DEPRECATED
260 QT_MOC_COMPAT void setHoverCloseButtonDelayed( bool delayed );
261#endif
262
272#ifndef KDE_NO_DEPRECATED
273 QT_MOC_COMPAT void setCloseButtonEnabled( bool );
274#endif
275
282#ifndef KDE_NO_DEPRECATED
283 QT_MOC_COMPAT void setTabCloseActivatePrevious( bool previous );
284#endif
285
292 void setAutomaticResizeTabs( bool enable );
293
294 Q_SIGNALS:
298 void testCanDecode(const QDragMoveEvent *e, bool &accept /* result */);
299
304 void receivedDropEvent( QDropEvent * );
305
310 void receivedDropEvent( QWidget *, QDropEvent * );
311
315 void initiateDrag( QWidget * );
316
320 void contextMenu( const QPoint & );
321
325 void contextMenu( QWidget *, const QPoint & );
326
327#ifndef KDE_NO_DEPRECATED
332 void movedTab( int, int );
333#endif
334
339 void mouseDoubleClick();
340
345 void mouseDoubleClick( QWidget * );
346
351 void mouseMiddleClick();
352
357 void mouseMiddleClick( QWidget * );
358
363 void closeRequest( QWidget * );
364
365 protected:
366 virtual void mouseDoubleClickEvent( QMouseEvent* );
367 virtual void mousePressEvent( QMouseEvent* );
368 virtual void mouseReleaseEvent( QMouseEvent* );
369 virtual void dragEnterEvent( QDragEnterEvent* );
370 virtual void dragMoveEvent( QDragMoveEvent* );
371 virtual void dropEvent( QDropEvent* );
372 int tabBarWidthForMaxChars( int );
373#ifndef QT_NO_WHEELEVENT
374 virtual void wheelEvent( QWheelEvent* );
375#endif
376 virtual void resizeEvent( QResizeEvent* );
377 virtual void tabInserted( int );
378 virtual void tabRemoved ( int );
379
383#ifndef KDE_NO_DEPRECATED
384 KDE_DEPRECATED void currentChanged( int );
385#endif
386
387 protected Q_SLOTS:
388 virtual void receivedDropEvent( int, QDropEvent* );
389 virtual void initiateDrag( int );
390 virtual void contextMenu( int, const QPoint& );
391 virtual void mouseDoubleClick( int );
392 virtual void mouseMiddleClick( int );
393 virtual void closeRequest( int );
394#ifndef QT_NO_WHEELEVENT
395 virtual void wheelDelta( int );
396#endif
397
398 private:
399 class Private;
400 Private * const d;
401
402 Q_PRIVATE_SLOT(d, void slotTabMoved(int, int))
403};
404
405#endif
KTabWidget
A widget containing multiple tabs.
Definition: ktabwidget.h:45
KTabWidget::closeRequest
void closeRequest(QWidget *)
The close button of a widget's tab was clicked.
KTabWidget::mouseDoubleClick
void mouseDoubleClick()
A double left mouse button click was performed over empty space besides tabbar.
KTabWidget::receivedDropEvent
void receivedDropEvent(QDropEvent *)
Received an event in the empty space beside tabbar.
KTabWidget::movedTab
void movedTab(int, int)
A tab was moved from first to second index.
KTabWidget::mouseMiddleClick
void mouseMiddleClick()
A middle mouse button click was performed over empty space besides tabbar.
KTabWidget::mouseDoubleClick
void mouseDoubleClick(QWidget *)
A double left mouse button click was performed over the widget.
KTabWidget::mouseMiddleClick
void mouseMiddleClick(QWidget *)
A middle mouse button click was performed over the widget.
KTabWidget::testCanDecode
void testCanDecode(const QDragMoveEvent *e, bool &accept)
Connect to this and set accept to true if you can and want to decode the event.
KTabWidget::contextMenu
void contextMenu(QWidget *, const QPoint &)
The right mouse button was pressed over a widget.
KTabWidget::receivedDropEvent
void receivedDropEvent(QWidget *, QDropEvent *)
Received an drop event on given widget's tab.
KTabWidget::initiateDrag
void initiateDrag(QWidget *)
Request to start a drag operation on the given tab.
KTabWidget::contextMenu
void contextMenu(const QPoint &)
The right mouse button was pressed over empty space besides tabbar.
QTabWidget
QWidget
kdeui_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal