KDEUI
ktabwidget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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;
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);
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 );
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 #ifndef QT_NO_WHEELEVENT
00331 virtual void wheelDelta( int );
00332 #endif
00333
00334 private:
00335 class Private;
00336 Private * const d;
00337 };
00338
00339 #endif