Eneboo - Documentación para desarrolladores
src/qt/include/qbuttongroup.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qbuttongroup.h   3.3.8   edited Jan 11 14:38 $
00003 **
00004 ** Definition of QButtonGroup class
00005 **
00006 ** Created : 950130
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 QBUTTONGROUP_H
00039 #define QBUTTONGROUP_H
00040 
00041 #ifndef QT_H
00042 #include "qgroupbox.h"
00043 #endif // QT_H
00044 
00045 #ifndef QT_NO_BUTTONGROUP
00046 
00047 
00048 class QButton;
00049 class QButtonList;
00050 
00051 
00052 class Q_EXPORT QButtonGroup : public QGroupBox
00053 {
00054     Q_OBJECT
00055     Q_PROPERTY( bool exclusive READ isExclusive WRITE setExclusive )
00056     Q_PROPERTY( bool radioButtonExclusive READ isRadioButtonExclusive WRITE setRadioButtonExclusive )
00057     Q_PROPERTY( int selectedId READ selectedId WRITE setButton )
00058 
00059 public:
00060     QButtonGroup( QWidget* parent=0, const char* name=0 );
00061     QButtonGroup( const QString &title,
00062                   QWidget* parent=0, const char* name=0 );
00063     QButtonGroup( int columns, Orientation o,
00064                   QWidget* parent=0, const char* name=0 );
00065     QButtonGroup( int columns, Orientation o, const QString &title,
00066                   QWidget* parent=0, const char* name=0 );
00067     ~QButtonGroup();
00068 
00069     bool        isExclusive() const;
00070     bool        isRadioButtonExclusive() const { return radio_excl; }
00071     virtual void setExclusive( bool );
00072     virtual void setRadioButtonExclusive( bool );
00073 
00074 public:
00075     int         insert( QButton *, int id=-1 );
00076     void        remove( QButton * );
00077     QButton    *find( int id ) const;
00078     int         id( QButton * ) const;
00079     int         count() const;
00080 
00081     virtual void setButton( int id );
00082 
00083     virtual void moveFocus( int );
00084 
00085     QButton    *selected() const;
00086     int    selectedId() const;
00087 
00088 signals:
00089     void        pressed( int id );
00090     void        released( int id );
00091     void        clicked( int id );
00092 
00093 protected slots:
00094     void        buttonPressed();
00095     void        buttonReleased();
00096     void        buttonClicked();
00097     void        buttonToggled( bool on );
00098 
00099 protected:
00100     bool        event( QEvent * e );
00101 
00102 private:
00103     void        init();
00104     bool        excl_grp;
00105     bool        radio_excl;
00106     QButtonList *buttons;
00107 
00108 private:        // Disabled copy constructor and operator=
00109 #if defined(Q_DISABLE_COPY)
00110     QButtonGroup( const QButtonGroup & );
00111     QButtonGroup &operator=( const QButtonGroup & );
00112 #endif
00113 };
00114 
00115 
00116 #endif // QT_NO_BUTTONGROUP
00117 
00118 #endif // QBUTTONGROUP_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'