Eneboo - Documentación para desarrolladores
src/qt/src/widgets/qgroupbox.h
Ir a la documentación de este archivo.
00001 /**********************************************************************
00002 ** $Id: qt/qgroupbox.h   3.3.8   edited Jan 11 14:38 $
00003 **
00004 ** Definition of QGroupBox widget class
00005 **
00006 ** Created : 950203
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 QGROUPBOX_H
00039 #define QGROUPBOX_H
00040 
00041 #ifndef QT_H
00042 #include "qframe.h"
00043 #endif // QT_H
00044 
00045 #ifndef QT_NO_GROUPBOX
00046 
00047 
00048 class QAccel;
00049 class QGroupBoxPrivate;
00050 class QVBoxLayout;
00051 class QGridLayout;
00052 class QSpacerItem;
00053 
00054 class Q_EXPORT QGroupBox : public QFrame
00055 {
00056     Q_OBJECT
00057     Q_PROPERTY( QString title READ title WRITE setTitle )
00058     Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment )
00059     Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation DESIGNABLE false )
00060     Q_PROPERTY( int columns READ columns WRITE setColumns DESIGNABLE false )
00061     Q_PROPERTY( bool flat READ isFlat WRITE setFlat )
00062 #ifndef QT_NO_CHECKBOX
00063     Q_PROPERTY( bool checkable READ isCheckable WRITE setCheckable )
00064     Q_PROPERTY( bool checked READ isChecked WRITE setChecked )
00065 #endif
00066 public:
00067     QGroupBox( QWidget* parent=0, const char* name=0 );
00068     QGroupBox( const QString &title,
00069                QWidget* parent=0, const char* name=0 );
00070     QGroupBox( int strips, Orientation o,
00071                QWidget* parent=0, const char* name=0 );
00072     QGroupBox( int strips, Orientation o, const QString &title,
00073                QWidget* parent=0, const char* name=0 );
00074     ~QGroupBox();
00075 
00076     virtual void setColumnLayout(int strips, Orientation o);
00077 
00078     QString title() const { return str; }
00079     virtual void setTitle( const QString &);
00080 
00081     int alignment() const { return align; }
00082     virtual void setAlignment( int );
00083 
00084     int columns() const;
00085     void setColumns( int );
00086 
00087     Orientation orientation() const { return dir; }
00088     void setOrientation( Orientation );
00089 
00090     int insideMargin() const;
00091     int insideSpacing() const;
00092     void setInsideMargin( int m );
00093     void setInsideSpacing( int s );
00094 
00095     void addSpace( int );
00096     QSize sizeHint() const;
00097 
00098     bool isFlat() const;
00099     void setFlat( bool b );
00100     bool isCheckable() const;
00101 #ifndef QT_NO_CHECKBOX
00102     void setCheckable( bool b );
00103 #endif
00104     bool isChecked() const;
00105     void setEnabled(bool on);
00106 
00107 #ifndef QT_NO_CHECKBOX
00108 public slots:
00109     void setChecked( bool b );
00110 
00111 signals:
00112     void toggled( bool );
00113 #endif
00114 protected:
00115     bool event( QEvent * );
00116     void childEvent( QChildEvent * );
00117     void resizeEvent( QResizeEvent * );
00118     void paintEvent( QPaintEvent * );
00119     void focusInEvent( QFocusEvent * );
00120     void fontChange( const QFont & );
00121 
00122 private slots:
00123     void fixFocus();
00124     void setChildrenEnabled( bool b );
00125 
00126 private:
00127     void skip();
00128     void init();
00129     void calculateFrame();
00130     void insertWid( QWidget* );
00131     void setTextSpacer();
00132 #ifndef QT_NO_CHECKBOX
00133     void updateCheckBoxGeometry();
00134 #endif
00135     QString str;
00136     int align;
00137     int lenvisible;
00138 #ifndef QT_NO_ACCEL
00139     QAccel * accel;
00140 #endif
00141     QGroupBoxPrivate * d;
00142 
00143     QVBoxLayout *vbox;
00144     QGridLayout *grid;
00145     int row;
00146     int col : 30;
00147     uint bFlat : 1;
00148     int nRows, nCols;
00149     Orientation dir;
00150     int spac, marg;
00151 
00152 private:        // Disabled copy constructor and operator=
00153 #if defined(Q_DISABLE_COPY)
00154     QGroupBox( const QGroupBox & );
00155     QGroupBox &operator=( const QGroupBox & );
00156 #endif
00157 };
00158 
00159 
00160 #endif // QT_NO_GROUPBOX
00161 
00162 #endif // QGROUPBOX_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'