• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • 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 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KTABWIDGET_H
00022 #define KTABWIDGET_H
00023 
00024 #include <kdeui_export.h>
00025 
00026 #include <QtGui/QTabWidget>
00027 
00028 class QTab;
00029 
00041 class KDEUI_EXPORT KTabWidget : public QTabWidget //krazy:exclude=qclasses
00042 {
00043     Q_OBJECT
00044     Q_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
00045     Q_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
00046     Q_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
00047     Q_PROPERTY( bool closeButtonEnabled READ isCloseButtonEnabled WRITE setCloseButtonEnabled )
00048     Q_PROPERTY( bool tabCloseActivatePrevious READ tabCloseActivatePrevious WRITE setTabCloseActivatePrevious )
00049     Q_PROPERTY( bool automaticResizeTabs READ automaticResizeTabs WRITE setAutomaticResizeTabs )
00050 
00051   public:
00052 
00059     explicit KTabWidget( QWidget *parent = 0, Qt::WFlags flags = 0 );
00060 
00064     virtual ~KTabWidget();
00065 
00070     void setTabTextColor( int index, const QColor& color );
00071 
00076     QColor tabTextColor( int index ) const;
00077 
00082     bool isTabReorderingEnabled() const;
00083 
00090     KDE_DEPRECATED bool hoverCloseButton() const;
00091 
00098     KDE_DEPRECATED bool hoverCloseButtonDelayed() const;
00099 
00105     bool isCloseButtonEnabled() const;
00106 
00111     bool tabCloseActivatePrevious() const;
00112 
00117     bool automaticResizeTabs() const;
00118 
00123     void setTabBarHidden( bool hide );
00124 
00128     bool isTabBarHidden() const;
00129 
00148     QString tabText( int ) const; // but it's not virtual...
00149 
00150 #ifdef KDE3_SUPPORT
00151 
00154     inline KDE_DEPRECATED QString label( int index ) const { return tabText( index ); }
00155 
00159     inline KDE_DEPRECATED QString tabLabel( QWidget *w ) const { return tabText( indexOf( w ) ); }
00160 
00164     inline KDE_DEPRECATED void setTabLabel( QWidget *w, const QString &l ) { setTabText( indexOf( w ),l ); }
00165 #endif
00166 
00170     void setTabText( int , const QString & );
00171 
00172   public Q_SLOTS:
00177     virtual void moveTab( int, int );
00178 
00184     virtual QT_MOC_COMPAT void removePage ( QWidget * w );
00185 
00190     virtual void removeTab(int index); // but it's not virtual in QTabWidget...
00191 
00201     void setTabReorderingEnabled( bool enable );
00202 
00210     QT_MOC_COMPAT void setHoverCloseButton( bool enable );
00211 
00218     QT_MOC_COMPAT void setHoverCloseButtonDelayed( bool delayed );
00219 
00227     void setCloseButtonEnabled( bool );
00228 
00233     void setTabCloseActivatePrevious( bool previous );
00234 
00241     void setAutomaticResizeTabs( bool enable );
00242 
00243   Q_SIGNALS:
00247     void testCanDecode(const QDragMoveEvent *e, bool &accept /* result */);
00248 
00253     void receivedDropEvent( QDropEvent * );
00254 
00259     void receivedDropEvent( QWidget *, QDropEvent * );
00260 
00264     void initiateDrag( QWidget * );
00265 
00269     void contextMenu( const QPoint & );
00270 
00274     void contextMenu( QWidget *, const QPoint & );
00275 
00280     void movedTab( int, int );
00281 
00285     void mouseDoubleClick();
00286 
00290     void mouseDoubleClick( QWidget * );
00291 
00295     void mouseMiddleClick();
00296 
00300     void mouseMiddleClick( QWidget * );
00301 
00306     void closeRequest( QWidget * );
00307 
00308   protected:
00309     virtual void mouseDoubleClickEvent( QMouseEvent* );
00310     virtual void mousePressEvent( QMouseEvent* );
00311     virtual void dragEnterEvent( QDragEnterEvent* );
00312     virtual void dragMoveEvent( QDragMoveEvent* );
00313     virtual void dropEvent( QDropEvent* );
00314     int tabBarWidthForMaxChars( int );
00315 #ifndef QT_NO_WHEELEVENT
00316     virtual void wheelEvent( QWheelEvent* );
00317 #endif
00318     virtual void resizeEvent( QResizeEvent* );
00319     virtual void tabInserted( int );
00320     virtual void tabRemoved ( int );
00321 
00322 
00323   protected Q_SLOTS:
00324     virtual void receivedDropEvent( int, QDropEvent* );
00325     virtual void initiateDrag( int );
00326     virtual void contextMenu( int, const QPoint& );
00327     virtual void mouseDoubleClick( int );
00328     virtual void mouseMiddleClick( int );
00329     virtual void closeRequest( int );
00330     void currentChanged( int );
00331 #ifndef QT_NO_WHEELEVENT
00332     virtual void wheelDelta( int );
00333 #endif
00334 
00335   private:
00336     class Private;
00337     Private * const d;
00338 };
00339 
00340 #endif

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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