Eneboo - Documentación para desarrolladores
src/qt/src/widgets/qtoolbox.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qtoolbox.h   3.3.8   edited Jan 11 14:39 $
00003 **
00004 ** Definition of QToolBox widget class
00005 **
00006 ** Created : 961105
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 QTOOLBOX_H
00039 #define QTOOLBOX_H
00040 
00041 #ifndef QT_H
00042 #include <qframe.h>
00043 #include <qiconset.h>
00044 #endif // QT_H
00045 
00046 #ifndef QT_NO_TOOLBOX
00047 
00048 class QToolBoxPrivate;
00049 class QWidgetList;
00050 
00051 class Q_EXPORT QToolBox : public QFrame
00052 {
00053     Q_OBJECT
00054     Q_PROPERTY( int currentIndex READ currentIndex WRITE setCurrentIndex )
00055     Q_PROPERTY( int count READ count )
00056 
00057 public:
00058     QToolBox( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00059     ~QToolBox();
00060 
00061     int addItem( QWidget *item, const QString &label );
00062     int addItem( QWidget *item, const QIconSet &iconSet, const QString &label );
00063     int insertItem( int index, QWidget *item, const QString &label );
00064     int insertItem( int index, QWidget *item, const QIconSet &iconSet, const QString &label );
00065 
00066     int removeItem( QWidget *item );
00067 
00068     void setItemEnabled( int index, bool enabled );
00069     bool isItemEnabled( int index ) const;
00070 
00071     void setItemLabel( int index, const QString &label );
00072     QString itemLabel( int index ) const;
00073 
00074     void setItemIconSet( int index, const QIconSet &iconSet );
00075     QIconSet itemIconSet( int index ) const;
00076 
00077     void setItemToolTip( int index, const QString &toolTip );
00078     QString itemToolTip( int index ) const;
00079 
00080     QWidget *currentItem() const;
00081     void setCurrentItem( QWidget *item );
00082 
00083     int currentIndex() const;
00084     QWidget *item( int index ) const;
00085     int indexOf( QWidget *item ) const;
00086     int count() const;
00087 
00088 public slots:
00089     void setCurrentIndex( int index );
00090 
00091 signals:
00092     void currentChanged( int index );
00093 
00094 private slots:
00095     void buttonClicked();
00096     void itemDestroyed(QObject*);
00097 
00098 protected:
00099     virtual void itemInserted( int index );
00100     virtual void itemRemoved( int index );
00101     void showEvent( QShowEvent *e );
00102     void frameChanged();
00103     void styleChange(QStyle&);
00104 
00105 private:
00106     void relayout();
00107 
00108 private:
00109     QToolBoxPrivate *d;
00110 
00111 };
00112 
00113 
00114 inline int QToolBox::addItem( QWidget *item, const QString &label )
00115 { return insertItem( -1, item, QIconSet(), label ); }
00116 inline int QToolBox::addItem( QWidget *item, const QIconSet &iconSet,
00117                               const QString &label )
00118 { return insertItem( -1, item, iconSet, label ); }
00119 inline int QToolBox::insertItem( int index, QWidget *item, const QString &label )
00120 { return insertItem( index, item, QIconSet(), label ); }
00121 
00122 #endif // QT_NO_TOOLBOX
00123 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'