Eneboo - Documentación para desarrolladores
src/qt/include/qtabwidget.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qtabwidget.h   3.3.8   edited Jan 11 14:39 $
00003 **
00004 ** Definition of QTabWidget class
00005 **
00006 ** Created : 990318
00007 **
00008 ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
00009 **
00010 ** This file is part of the widgets module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech ASA of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QTABWIDGET_H
00039 #define QTABWIDGET_H
00040 
00041 #ifndef QT_H
00042 #include "qwidget.h"
00043 #include "qiconset.h"
00044 #endif // QT_H
00045 
00046 #ifndef QT_NO_TABWIDGET
00047 
00048 class QTabBar;
00049 class QTabWidgetData;
00050 class QTab;
00051 class QWidgetStack;
00052 
00053 
00054 class Q_EXPORT QTabWidget : public QWidget
00055 {
00056     Q_OBJECT
00057     Q_ENUMS( TabPosition )
00058     Q_ENUMS( TabShape )
00059     Q_PROPERTY( TabPosition tabPosition READ tabPosition WRITE setTabPosition )
00060     Q_PROPERTY( TabShape tabShape READ tabShape WRITE setTabShape )
00061     Q_PROPERTY( int margin READ margin WRITE setMargin )
00062     Q_PROPERTY( int currentPage READ currentPageIndex WRITE setCurrentPage )
00063     Q_PROPERTY( int count READ count )
00064     Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true )
00065 
00066 public:
00067     QTabWidget( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00068     ~QTabWidget();
00069 
00070     virtual void addTab( QWidget *, const QString & ); // ### make these inline in 4.0
00071     virtual void addTab( QWidget *child, const QIconSet& iconset,
00072                          const QString &label );
00073     virtual void addTab( QWidget *, QTab* );
00074 
00075     virtual void insertTab( QWidget *, const QString &, int index = -1 );
00076     virtual void insertTab( QWidget *child, const QIconSet& iconset,
00077                             const QString &label, int index = -1 );
00078     virtual void insertTab( QWidget *, QTab*, int index = -1 );
00079 
00080     void changeTab( QWidget *, const QString &);
00081     void changeTab( QWidget *child, const QIconSet& iconset,
00082                     const QString &label );
00083 
00084     bool isTabEnabled(  QWidget * ) const;
00085     void setTabEnabled( QWidget *, bool );
00086 
00087     void setCornerWidget( QWidget * w, Qt::Corner corner = Qt::TopRight );
00088     QWidget * cornerWidget( Qt::Corner corner = Qt::TopRight ) const;
00089 
00090     QString tabLabel( QWidget * ) const;
00091     void setTabLabel( QWidget *p, const QString &l );
00092 
00093     QIconSet tabIconSet( QWidget * w ) const;
00094     void setTabIconSet( QWidget * w, const QIconSet & iconset );
00095 
00096     void removeTabToolTip( QWidget * w );
00097     void setTabToolTip( QWidget * w, const QString & tip );
00098     QString tabToolTip( QWidget * w ) const;
00099 
00100     QWidget * currentPage() const;
00101     QWidget *page( int ) const;
00102     QString label( int ) const;
00103     int currentPageIndex() const;
00104     int indexOf( QWidget * ) const;
00105 
00106     QSize sizeHint() const;
00107     QSize minimumSizeHint() const;
00108 
00109     enum TabPosition { Top, Bottom };
00110     TabPosition tabPosition() const;
00111     void setTabPosition( TabPosition );
00112 
00113     enum TabShape { Rounded, Triangular };
00114     TabShape tabShape() const;
00115     void setTabShape( TabShape s );
00116 
00117     int margin() const;
00118     void setMargin( int );
00119 
00120     int count() const;
00121 
00122 public slots:
00123     void setCurrentPage( int );
00124     virtual void showPage( QWidget * );
00125     virtual void removePage( QWidget * );
00126 
00127 protected:
00128     void showEvent( QShowEvent * );
00129     void resizeEvent( QResizeEvent * );
00130     void setTabBar( QTabBar * );
00131     QTabBar* tabBar() const;
00132     void styleChange( QStyle& );
00133     void updateMask();
00134     bool eventFilter( QObject *, QEvent * );
00135 
00136 signals:
00137     void currentChanged( QWidget * );
00138 #ifndef Q_QDOC
00139     void selected( const QString& );
00140 #endif
00141 
00142 private slots:
00143     void showTab( int );
00144 
00145 private:
00146     QTabWidgetData *d;
00147     void setUpLayout( bool = FALSE );
00148     friend class QTabDialog;
00149 
00150 private:        // Disabled copy constructor and operator=
00151 #if defined(Q_DISABLE_COPY)
00152     QTabWidget( const QTabWidget & );
00153     QTabWidget& operator=( const QTabWidget & );
00154 #endif
00155 };
00156 
00157 #endif // QT_NO_TABWIDGET
00158 
00159 #endif // QTABWIDGET_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'