Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef QTXCOMBOBOX_H
00027 #define QTXCOMBOBOX_H
00028
00029 #include "Qtx.h"
00030
00031 #include <QMap>
00032 #include <QComboBox>
00033
00034 #ifdef WIN32
00035 #pragma warning( disable:4251 )
00036 #endif
00037
00038 class QTX_EXPORT QtxComboBox : public QComboBox
00039 {
00040 Q_OBJECT
00041
00042 class Model;
00043 class ClearEvent;
00044
00045 public:
00046 QtxComboBox( QWidget* = 0 );
00047 virtual ~QtxComboBox();
00048
00049 bool isCleared() const;
00050 void setCleared( const bool );
00051
00052 int currentId() const;
00053 void setCurrentId( int );
00054
00055 int id( const int ) const;
00056 int index( const int ) const;
00057
00058 bool hasId( const int ) const;
00059 void setId( const int, const int );
00060
00061 signals:
00062 void activatedId( int );
00063
00064 private slots:
00065 void onCurrentChanged( int );
00066
00067 protected:
00068 virtual void paintEvent( QPaintEvent* );
00069 virtual void childEvent( QChildEvent* );
00070 virtual void customEvent( QEvent* );
00071
00072 private:
00073 void resetClear();
00074
00075 private:
00076 enum { IdRole = Qt::UserRole + 10 };
00077
00078 private:
00079 bool myCleared;
00080 };
00081
00082 #ifdef WIN32
00083 #pragma warning( default:4251 )
00084 #endif
00085
00086 #endif