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
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
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;
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);
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 );
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