• Skip to content
  • Skip to link menu
KDE 4.3 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     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 
00042 class KDEUI_EXPORT KTabWidget : public QTabWidget //krazy:exclude=qclasses
00043 {
00044     Q_OBJECT
00045     Q_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
00046     Q_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
00047     Q_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
00048     Q_PROPERTY( bool closeButtonEnabled READ isCloseButtonEnabled WRITE setCloseButtonEnabled )
00049     Q_PROPERTY( bool tabCloseActivatePrevious READ tabCloseActivatePrevious WRITE setTabCloseActivatePrevious )
00050     Q_PROPERTY( bool automaticResizeTabs READ automaticResizeTabs WRITE setAutomaticResizeTabs )
00051 
00052   public:
00053 
00060     explicit KTabWidget( QWidget *parent = 0, Qt::WFlags flags = 0 );
00061 
00065     virtual ~KTabWidget();
00066 
00071     void setTabTextColor( int index, const QColor& color );
00072 
00077     QColor tabTextColor( int index ) const;
00078 
00085     bool isTabReorderingEnabled() const;
00086 
00093     KDE_DEPRECATED bool hoverCloseButton() const;
00094 
00101     KDE_DEPRECATED bool hoverCloseButtonDelayed() const;
00102 
00110     KDE_DEPRECATED bool isCloseButtonEnabled() const;
00111 
00118     KDE_DEPRECATED bool tabCloseActivatePrevious() const;
00119 
00124     bool automaticResizeTabs() const;
00125 
00130     void setTabBarHidden( bool hide );
00131 
00135     bool isTabBarHidden() const;
00136 
00155     QString tabText( int ) const; // but it's not virtual...
00156 
00157 #ifdef KDE3_SUPPORT
00158 
00161     inline KDE_DEPRECATED QString label( int index ) const { return tabText( index ); }
00162 
00166     inline KDE_DEPRECATED QString tabLabel( QWidget *w ) const { return tabText( indexOf( w ) ); }
00167 
00171     inline KDE_DEPRECATED void setTabLabel( QWidget *w, const QString &l ) { setTabText( indexOf( w ),l ); }
00172 #endif
00173 
00177     void setTabText( int , const QString & );
00178 
00179   public Q_SLOTS:
00184     virtual void moveTab( int, int );
00185 
00191     virtual QT_MOC_COMPAT void removePage ( QWidget * w );
00192 
00197     virtual void removeTab(int index); // but it's not virtual in QTabWidget...
00198 
00210     QT_MOC_COMPAT void setTabReorderingEnabled( bool enable );
00211 
00219     QT_MOC_COMPAT void setHoverCloseButton( bool enable );
00220 
00227     QT_MOC_COMPAT void setHoverCloseButtonDelayed( bool delayed );
00228 
00238     QT_MOC_COMPAT void setCloseButtonEnabled( bool );
00239 
00246     QT_MOC_COMPAT void setTabCloseActivatePrevious( bool previous );
00247 
00254     void setAutomaticResizeTabs( bool enable );
00255 
00256   Q_SIGNALS:
00260     void testCanDecode(const QDragMoveEvent *e, bool &accept /* result */);
00261 
00266     void receivedDropEvent( QDropEvent * );
00267 
00272     void receivedDropEvent( QWidget *, QDropEvent * );
00273 
00277     void initiateDrag( QWidget * );
00278 
00282     void contextMenu( const QPoint & );
00283 
00287     void contextMenu( QWidget *, const QPoint & );
00288 
00293     void movedTab( int, int );
00294 
00298     void mouseDoubleClick();
00299 
00303     void mouseDoubleClick( QWidget * );
00304 
00308     void mouseMiddleClick();
00309 
00313     void mouseMiddleClick( QWidget * );
00314 
00319     void closeRequest( QWidget * );
00320 
00321   protected:
00322     virtual void mouseDoubleClickEvent( QMouseEvent* );
00323     virtual void mousePressEvent( QMouseEvent* );
00324     virtual void mouseReleaseEvent( QMouseEvent* );
00325     virtual void dragEnterEvent( QDragEnterEvent* );
00326     virtual void dragMoveEvent( QDragMoveEvent* );
00327     virtual void dropEvent( QDropEvent* );
00328     int tabBarWidthForMaxChars( int );
00329 #ifndef QT_NO_WHEELEVENT
00330     virtual void wheelEvent( QWheelEvent* );
00331 #endif
00332     virtual void resizeEvent( QResizeEvent* );
00333     virtual void tabInserted( int );
00334     virtual void tabRemoved ( int );
00335 
00336 
00337   protected Q_SLOTS:
00338     virtual void receivedDropEvent( int, QDropEvent* );
00339     virtual void initiateDrag( int );
00340     virtual void contextMenu( int, const QPoint& );
00341     virtual void mouseDoubleClick( int );
00342     virtual void mouseMiddleClick( int );
00343     virtual void closeRequest( int );
00344     void currentChanged( int );
00345 #ifndef QT_NO_WHEELEVENT
00346     virtual void wheelDelta( int );
00347 #endif
00348 
00349   private:
00350     class Private;
00351     Private * const d;
00352 };
00353 
00354 #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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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