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

KDEUI

ktabwidget.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2003 Stephan Binner <binner@kde.org>
00003     Copyright (C) 2003 Zack Rusin <zack@kde.org>
00004     Copyright (C) 2009 Urs Wolfer <uwolfer @ kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KTABWIDGET_H
00023 #define KTABWIDGET_H
00024 
00025 #include <kdeui_export.h>
00026 
00027 #include <QtGui/QTabWidget>
00028 
00029 class QTab;
00030 
00044 class KDEUI_EXPORT KTabWidget : public QTabWidget //krazy:exclude=qclasses
00045 {
00046     Q_OBJECT
00047 #ifndef KDE_NO_DEPRECATED
00048     Q_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
00049     Q_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
00050     Q_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
00051     Q_PROPERTY( bool closeButtonEnabled READ isCloseButtonEnabled WRITE setCloseButtonEnabled )
00052     Q_PROPERTY( bool tabCloseActivatePrevious READ tabCloseActivatePrevious WRITE setTabCloseActivatePrevious )
00053 #endif
00054     Q_PROPERTY( bool automaticResizeTabs READ automaticResizeTabs WRITE setAutomaticResizeTabs )
00055 
00056   public:
00057 
00064     explicit KTabWidget( QWidget *parent = 0, Qt::WFlags flags = 0 );
00065 
00069     virtual ~KTabWidget();
00070 
00075     void setTabTextColor( int index, const QColor& color );
00076 
00081     QColor tabTextColor( int index ) const;
00082 
00089 #ifndef KDE_NO_DEPRECATED
00090     KDE_DEPRECATED bool isTabReorderingEnabled() const;
00091 #endif
00092 
00099 #ifndef KDE_NO_DEPRECATED
00100     KDE_DEPRECATED bool hoverCloseButton() const;
00101 #endif
00102 
00109 #ifndef KDE_NO_DEPRECATED
00110     KDE_DEPRECATED bool hoverCloseButtonDelayed() const;
00111 #endif
00112 
00120 #ifndef KDE_NO_DEPRECATED
00121     KDE_DEPRECATED bool isCloseButtonEnabled() const;
00122 #endif
00123 
00130 #ifndef KDE_NO_DEPRECATED
00131     KDE_DEPRECATED bool tabCloseActivatePrevious() const;
00132 #endif
00133 
00138     bool automaticResizeTabs() const;
00139 
00144     void setTabBarHidden( bool hide );
00145 
00151     bool isTabBarHidden() const;
00152 
00171     QString tabText( int ) const; // but it's not virtual...
00172 
00173 #ifdef KDE3_SUPPORT
00174 
00177 #ifndef KDE_NO_DEPRECATED
00178     inline KDE_DEPRECATED QString label( int index ) const { return tabText( index ); }
00179 #endif
00180 
00184 #ifndef KDE_NO_DEPRECATED
00185     inline KDE_DEPRECATED QString tabLabel( QWidget *w ) const { return tabText( indexOf( w ) ); }
00186 #endif
00187 
00191 #ifndef KDE_NO_DEPRECATED
00192     inline KDE_DEPRECATED void setTabLabel( QWidget *w, const QString &l ) { setTabText( indexOf( w ),l ); }
00193 #endif
00194 #endif
00195 
00199     void setTabText( int , const QString & );
00200 
00201     using QTabWidget::tabBar;
00202 
00203   public Q_SLOTS:
00208     virtual void moveTab( int, int );
00209 
00215     virtual QT_MOC_COMPAT void removePage ( QWidget * w );
00216 
00221     virtual void removeTab(int index); // but it's not virtual in QTabWidget...
00222 
00238 #ifndef KDE_NO_DEPRECATED
00239     QT_MOC_COMPAT void setTabReorderingEnabled( bool enable );
00240 #endif
00241 
00249 #ifndef KDE_NO_DEPRECATED
00250     QT_MOC_COMPAT void setHoverCloseButton( bool enable );
00251 #endif
00252 
00259 #ifndef KDE_NO_DEPRECATED
00260     QT_MOC_COMPAT void setHoverCloseButtonDelayed( bool delayed );
00261 #endif
00262 
00272 #ifndef KDE_NO_DEPRECATED
00273     QT_MOC_COMPAT void setCloseButtonEnabled( bool );
00274 #endif
00275 
00282 #ifndef KDE_NO_DEPRECATED
00283     QT_MOC_COMPAT void setTabCloseActivatePrevious( bool previous );
00284 #endif
00285 
00292     void setAutomaticResizeTabs( bool enable );
00293 
00294   Q_SIGNALS:
00298     void testCanDecode(const QDragMoveEvent *e, bool &accept /* result */);
00299 
00304     void receivedDropEvent( QDropEvent * );
00305 
00310     void receivedDropEvent( QWidget *, QDropEvent * );
00311 
00315     void initiateDrag( QWidget * );
00316 
00320     void contextMenu( const QPoint & );
00321 
00325     void contextMenu( QWidget *, const QPoint & );
00326 
00327 #ifndef KDE_NO_DEPRECATED
00328 
00332     void movedTab( int, int );
00333 #endif
00334 
00339     void mouseDoubleClick();
00340 
00345     void mouseDoubleClick( QWidget * );
00346 
00351     void mouseMiddleClick();
00352 
00357     void mouseMiddleClick( QWidget * );
00358 
00363     void closeRequest( QWidget * );
00364 
00365   protected:
00366     virtual void mouseDoubleClickEvent( QMouseEvent* );
00367     virtual void mousePressEvent( QMouseEvent* );
00368     virtual void mouseReleaseEvent( QMouseEvent* );
00369     virtual void dragEnterEvent( QDragEnterEvent* );
00370     virtual void dragMoveEvent( QDragMoveEvent* );
00371     virtual void dropEvent( QDropEvent* );
00372     int tabBarWidthForMaxChars( int );
00373 #ifndef QT_NO_WHEELEVENT
00374     virtual void wheelEvent( QWheelEvent* );
00375 #endif
00376     virtual void resizeEvent( QResizeEvent* );
00377     virtual void tabInserted( int );
00378     virtual void tabRemoved ( int );
00379 
00383 #ifndef KDE_NO_DEPRECATED
00384     KDE_DEPRECATED void currentChanged( int );
00385 #endif
00386 
00387   protected Q_SLOTS:
00388     virtual void receivedDropEvent( int, QDropEvent* );
00389     virtual void initiateDrag( int );
00390     virtual void contextMenu( int, const QPoint& );
00391     virtual void mouseDoubleClick( int );
00392     virtual void mouseMiddleClick( int );
00393     virtual void closeRequest( int );
00394 #ifndef QT_NO_WHEELEVENT
00395     virtual void wheelDelta( int );
00396 #endif
00397 
00398   private:
00399     class Private;
00400     Private * const d;
00401 
00402     Q_PRIVATE_SLOT(d, void slotTabMoved(int, int))
00403 };
00404 
00405 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed May 2 2012 17:57:52 by doxygen 1.8.0 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.8.3 API Reference

Skip menu "kdelibs-4.8.3 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