ktabwidget.h
/* This file is part of the KDE libraries
Copyright (C) 2003 Stephan Binner <binner@kde.org>
Copyright (C) 2003 Zack Rusin <zack@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KTABWIDGET_H
#define KTABWIDGET_H
#include <qtabwidget.h>
#include <qstringlist.h>
#include <kdelibs_export.h>
class KTabWidgetPrivate;
class KDEUI_EXPORT KTabWidget : public QTabWidget
{
Q_OBJECT
Q_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
Q_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
Q_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
Q_PROPERTY( bool tabCloseActivatePrevious READ tabCloseActivatePrevious WRITE setTabCloseActivatePrevious )
Q_PROPERTY( bool automaticResizeTabs READ automaticResizeTabs WRITE setAutomaticResizeTabs )
public:
KTabWidget( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
virtual ~KTabWidget();
void setTabColor( QWidget *, const QColor& color );
QColor tabColor( QWidget * ) const;
bool isTabReorderingEnabled() const;
bool hoverCloseButton() const;
bool hoverCloseButtonDelayed() const;
bool tabCloseActivatePrevious() const;
bool automaticResizeTabs() const;
void setTabBarHidden( bool hide );
bool isTabBarHidden() const;
virtual void insertTab( QWidget *, const QString &, int index = -1 );
virtual void insertTab( QWidget *child, const QIconSet& iconset,
const QString &label, int index = -1 );
virtual void insertTab( QWidget *, QTab *, int index = -1 );
void changeTab( QWidget *, const QString & );
void changeTab( QWidget *child, const QIconSet& iconset, const QString &label );
QString label( int ) const;
QString tabLabel( QWidget * ) const;
void setTabLabel( QWidget *, const QString & );
public slots:
virtual void moveTab( int, int );
virtual void removePage ( QWidget * w );
void setTabReorderingEnabled( bool enable );
void setHoverCloseButton( bool enable );
void setHoverCloseButtonDelayed( bool delayed );
void setTabCloseActivatePrevious( bool previous );
void setAutomaticResizeTabs( bool enable );
signals:
void testCanDecode(const QDragMoveEvent *e, bool &accept /* result */);
void receivedDropEvent( QDropEvent * );
void receivedDropEvent( QWidget *, QDropEvent * );
void initiateDrag( QWidget * );
void contextMenu( const QPoint & );
void contextMenu( QWidget *, const QPoint & );
void movedTab( int, int );
void mouseDoubleClick();
void mouseDoubleClick( QWidget * );
void mouseMiddleClick();
void mouseMiddleClick( QWidget * );
void closeRequest( QWidget * );
protected:
virtual void mouseDoubleClickEvent( QMouseEvent *e );
virtual void mousePressEvent( QMouseEvent * );
virtual void dragMoveEvent( QDragMoveEvent * );
virtual void dropEvent( QDropEvent * );
unsigned int tabBarWidthForMaxChars( uint maxLength );
#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent( QWheelEvent *e );
#endif
virtual void resizeEvent( QResizeEvent * );
protected slots:
virtual void receivedDropEvent( int, QDropEvent * );
virtual void initiateDrag( int );
virtual void contextMenu( int, const QPoint & );
virtual void mouseDoubleClick( int );
virtual void mouseMiddleClick( int );
virtual void closeRequest( int );
#ifndef QT_NO_WHEELEVENT
virtual void wheelDelta( int );
#endif
private:
bool isEmptyTabbarSpace( const QPoint & ) const;
void resizeTabs( int changedTabIndex = -1 );
void updateTab( int index );
KTabWidgetPrivate *d;
};
#endif
KTabWidget
A widget containing multiple tabs.
Definition: ktabwidget.h:36

KDE Home | KDE Accessibility Home | Description of Access Keys