/****************************************************************************
** $Id: qtabbar.h,v 2.12.2.2 1998/09/03 20:14:48 hanord Exp $
**
** Definition of QTabBar class
**
** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved.
**
** This file is part of Troll Tech's internal development tree for Qt.
**
** This header text will be replaced by an appropriate text by the
** mkdist script which generates external distributions.
**
** If you are using the Qt Professional Edition or the Qt Free Edition,
** please notify Troll Tech at <info@troll.no> if you see this text.
**
** To Troll Tech developers: This header was generated by the script
** fixcopyright-int. It has the same number of text lines as the free
** and professional editions to avoid line number inconsistency.
**
*****************************************************************************/
#ifndef QTABBAR_H
#define QTABBAR_H
#ifndef QT_H
#include "qwidget.h"
#include "qpainter.h"
#include "qlist.h"
#endif // QT_H
struct QTabPrivate;
struct Q_EXPORT QTab
{
QTab(): enabled( TRUE ), id( 0 ) {}
virtual ~QTab();
QString label;
// the bounding rectangle of this - may overlap with others
QRect r;
bool enabled;
int id;
};
class Q_EXPORT QTabBar: public QWidget
{
Q_OBJECT
public:
QTabBar( QWidget * parent = 0, const char * name = 0 );
~QTabBar();
enum Shape { RoundedAbove, RoundedBelow,
TriangularAbove, TriangularBelow };
Shape shape() const;
void setShape( Shape );
void show();
virtual int addTab( QTab * );
void setTabEnabled( int, bool );
bool isTabEnabled( int ) const;
QSize sizeHint() const;
int currentTab() const;
int keyboardFocusTab() const;
QTab * tab( int );
public slots:
void setCurrentTab( int );
void setCurrentTab( QTab * );
signals:
void selected( int );
protected:
virtual void paint( QPainter *, QTab *, bool ) const;
virtual QTab * selectTab( const QPoint & p ) const;
void paintEvent( QPaintEvent * );
void mousePressEvent ( QMouseEvent * );
void mouseReleaseEvent ( QMouseEvent * );
void keyPressEvent( QKeyEvent * );
QListT<QTab> * tabList();
private:
QListT<QTab> * l;
QTabPrivate * d;
void paintLabel( QPainter*, const QRect&, QTab*, bool ) const;
};
#endif // QTABBAR_H
| Copyright © 1998 Troll Tech | Trademarks | Qt version 1.41
|