[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qtabbar.h:1 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>qtabbar.h Include File</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qtabbar.h</h1>
|
---|
| 33 |
|
---|
| 34 | <p>This is the verbatim text of the qtabbar.h include file. It is provided only for illustration; the copyright remains with Trolltech.
|
---|
| 35 | <hr>
|
---|
| 36 | <pre>
|
---|
| 37 | /****************************************************************************
|
---|
| 38 | ** $Id: qtabbar-h.html 2051 2007-02-21 10:04:20Z chehrlic $
|
---|
| 39 | **
|
---|
| 40 | ** Definition of QTab and QTabBar classes
|
---|
| 41 | **
|
---|
| 42 | ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
|
---|
| 43 | **
|
---|
| 44 | ** This file is part of the widgets module of the Qt GUI Toolkit.
|
---|
| 45 | **
|
---|
| 46 | ** This file may be distributed under the terms of the Q Public License
|
---|
| 47 | ** as defined by Trolltech ASA of Norway and appearing in the file
|
---|
| 48 | ** LICENSE.QPL included in the packaging of this file.
|
---|
| 49 | **
|
---|
| 50 | ** This file may be distributed and/or modified under the terms of the
|
---|
| 51 | ** GNU General Public License version 2 as published by the Free Software
|
---|
| 52 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 53 | ** packaging of this file.
|
---|
| 54 | **
|
---|
| 55 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
| 56 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
| 57 | ** Agreement provided with the Software.
|
---|
| 58 | **
|
---|
| 59 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
| 60 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
| 61 | **
|
---|
| 62 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
| 63 | ** information about Qt Commercial License Agreements.
|
---|
| 64 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
---|
| 65 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
| 66 | **
|
---|
| 67 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
| 68 | ** not clear to you.
|
---|
| 69 | **
|
---|
| 70 | **********************************************************************/
|
---|
| 71 |
|
---|
| 72 | #ifndef QTABBAR_H
|
---|
| 73 | #define QTABBAR_H
|
---|
| 74 |
|
---|
| 75 | #ifndef QT_H
|
---|
| 76 | #include "qwidget.h"
|
---|
| 77 | #include "qptrlist.h"
|
---|
| 78 | #endif // QT_H
|
---|
| 79 |
|
---|
| 80 | #ifndef QT_NO_TABBAR
|
---|
| 81 |
|
---|
| 82 | class QTabBar;
|
---|
| 83 | class QIconSet;
|
---|
| 84 |
|
---|
| 85 | class Q_EXPORT QTab : public Qt
|
---|
| 86 | {
|
---|
| 87 | friend class QTabBar;
|
---|
| 88 | friend class QTabWidget;
|
---|
| 89 |
|
---|
| 90 | public:
|
---|
| 91 | QTab();
|
---|
| 92 | virtual ~QTab();
|
---|
| 93 | QTab( const QString& text );
|
---|
| 94 | QTab( const QIconSet& icon, const QString& text = QString::null );
|
---|
| 95 |
|
---|
| 96 | void setText( const QString& text);
|
---|
| 97 | QString text() const { return label; }
|
---|
| 98 | void setIconSet( const QIconSet& icon );
|
---|
| 99 | QIconSet* iconSet() const { return iconset; }
|
---|
| 100 | void setRect( const QRect& rect ) { r = rect; }
|
---|
| 101 | QRect rect() const { return r; }
|
---|
| 102 | void setEnabled( bool enable ) { enabled = enable; }
|
---|
| 103 | bool isEnabled() const { return enabled; }
|
---|
| 104 | void setIdentifier( int i ) { id = i; }
|
---|
| 105 | int identifier() const { return id; }
|
---|
| 106 |
|
---|
| 107 | private:
|
---|
| 108 | void setTabBar( QTabBar *tb );
|
---|
| 109 | QString label;
|
---|
| 110 | QRect r; // the bounding rectangle of this (may overlap with others)
|
---|
| 111 | bool enabled;
|
---|
| 112 | int id;
|
---|
| 113 | QIconSet* iconset; // optional iconset
|
---|
| 114 | QTabBar *tb;
|
---|
| 115 | };
|
---|
| 116 |
|
---|
| 117 |
|
---|
| 118 | struct QTabPrivate;
|
---|
| 119 | //class *QAccel;
|
---|
| 120 |
|
---|
| 121 | class Q_EXPORT QTabBar: public QWidget
|
---|
| 122 | {
|
---|
| 123 | Q_OBJECT
|
---|
| 124 | Q_ENUMS( Shape )
|
---|
| 125 | Q_PROPERTY( Shape shape READ shape WRITE setShape )
|
---|
| 126 | Q_PROPERTY( int currentTab READ currentTab WRITE setCurrentTab )
|
---|
| 127 | Q_PROPERTY( int count READ count )
|
---|
| 128 | Q_PROPERTY( int keyboardFocusTab READ keyboardFocusTab )
|
---|
| 129 |
|
---|
| 130 | public:
|
---|
| 131 | QTabBar( QWidget* parent=0, const char* name=0 );
|
---|
| 132 | ~QTabBar();
|
---|
| 133 |
|
---|
| 134 | enum Shape { RoundedAbove, RoundedBelow,
|
---|
| 135 | TriangularAbove, TriangularBelow };
|
---|
| 136 |
|
---|
| 137 | Shape shape() const;
|
---|
| 138 | virtual void setShape( Shape );
|
---|
| 139 |
|
---|
| 140 | void show();
|
---|
| 141 |
|
---|
| 142 | virtual int addTab( QTab * );
|
---|
| 143 | virtual int insertTab( QTab *, int index = -1 );
|
---|
| 144 | virtual void removeTab( QTab * );
|
---|
| 145 |
|
---|
| 146 | virtual void setTabEnabled( int, bool );
|
---|
| 147 | bool isTabEnabled( int ) const;
|
---|
| 148 |
|
---|
| 149 |
|
---|
| 150 | QSize sizeHint() const;
|
---|
| 151 | QSize minimumSizeHint() const;
|
---|
| 152 |
|
---|
| 153 | int currentTab() const;
|
---|
| 154 | int keyboardFocusTab() const;
|
---|
| 155 |
|
---|
| 156 | QTab * tab( int ) const;
|
---|
| 157 | QTab * tabAt( int ) const;
|
---|
| 158 | int indexOf( int ) const;
|
---|
| 159 | int count() const;
|
---|
| 160 |
|
---|
| 161 | virtual void layoutTabs();
|
---|
| 162 | virtual QTab * selectTab( const QPoint & p ) const;
|
---|
| 163 |
|
---|
| 164 | void removeToolTip( int index );
|
---|
| 165 | void setToolTip( int index, const QString & tip );
|
---|
| 166 | QString toolTip( int index ) const;
|
---|
| 167 |
|
---|
| 168 | public slots:
|
---|
| 169 | virtual void setCurrentTab( int );
|
---|
| 170 | virtual void setCurrentTab( QTab * );
|
---|
| 171 |
|
---|
| 172 | signals:
|
---|
| 173 | void selected( int );
|
---|
| 174 | void layoutChanged();
|
---|
| 175 |
|
---|
| 176 | protected:
|
---|
| 177 | virtual void paint( QPainter *, QTab *, bool ) const; // ### not const
|
---|
| 178 | virtual void paintLabel( QPainter*, const QRect&, QTab*, bool ) const;
|
---|
| 179 |
|
---|
| 180 | void focusInEvent( QFocusEvent *e );
|
---|
| 181 | void focusOutEvent( QFocusEvent *e );
|
---|
| 182 |
|
---|
| 183 | void resizeEvent( QResizeEvent * );
|
---|
| 184 | void paintEvent( QPaintEvent * );
|
---|
| 185 | void mousePressEvent ( QMouseEvent * );
|
---|
| 186 | void mouseMoveEvent ( QMouseEvent * );
|
---|
| 187 | void mouseReleaseEvent ( QMouseEvent * );
|
---|
| 188 | void keyPressEvent( QKeyEvent * );
|
---|
| 189 | void styleChange( QStyle& );
|
---|
| 190 | void fontChange ( const QFont & );
|
---|
| 191 |
|
---|
| 192 | bool event( QEvent *e );
|
---|
| 193 |
|
---|
| 194 | QPtrList<QTab> * tabList();
|
---|
| 195 |
|
---|
| 196 | private slots:
|
---|
| 197 | void scrollTabs();
|
---|
| 198 |
|
---|
| 199 | private:
|
---|
| 200 | QPtrList<QTab> * l;
|
---|
| 201 | QPtrList<QTab> * lstatic;
|
---|
| 202 | void makeVisible( QTab* t = 0 );
|
---|
| 203 | void updateArrowButtons();
|
---|
| 204 | QTabPrivate * d;
|
---|
| 205 |
|
---|
| 206 | friend class QTabBarToolTip;
|
---|
| 207 | friend class QTab;
|
---|
| 208 |
|
---|
| 209 | private: // Disabled copy constructor and operator=
|
---|
| 210 | #if defined(Q_DISABLE_COPY)
|
---|
| 211 | QTabBar( const QTabBar & );
|
---|
| 212 | QTabBar& operator=( const QTabBar & );
|
---|
| 213 | #endif
|
---|
| 214 | };
|
---|
| 215 |
|
---|
| 216 |
|
---|
| 217 | #endif // QT_NO_TABBAR
|
---|
| 218 |
|
---|
| 219 | #endif // QTABBAR_H
|
---|
| 220 | </pre>
|
---|
| 221 | <!-- eof -->
|
---|
| 222 | <p><address><hr><div align=center>
|
---|
| 223 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 224 | <td>Copyright © 2007
|
---|
| 225 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 226 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 227 | </table></div></address></body>
|
---|
| 228 | </html>
|
---|