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

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • 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 
29 class QTab;
30 
44 class 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
174 
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
328 
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
QColor
KStandardShortcut::label
QString label(StandardShortcut id)
Returns a localized label for user-visible display.
Definition: kstandardshortcut.cpp:267
QWidget
QString
QPoint
kdeui_export.h
QTabWidget
KTabWidget
A widget containing multiple tabs.
Definition: ktabwidget.h:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:15 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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