00001 #ifndef ACOMBOBOX_H
00002 #define ACOMBOBOX_H
00003
00004 #include <QComboBox>
00005 #include <QLineEdit>
00006 #include <QString>
00007 #include <QDebug>
00008 #include <QCompleter>
00009 #include "../Models/accountmodel.h"
00010
00017 class AComboBox : public QComboBox
00018 {
00019 Q_OBJECT
00020 public:
00021 AComboBox(const QString &defaultValue, AccountModel *model, const QString &text = "", QWidget *parent = 0);
00022 AComboBox(const QString &defaultValue, AccountModel *model, QWidget *parent = 0);
00023 QString hintText() const;
00024 void setCurrentIndex(int index, bool created = false);
00025 void setHintText(QString hintText);
00026 void showHintText();
00027 void hideHintText();
00028 void focusInEvent(QFocusEvent *e);
00029 void focusOutEvent(QFocusEvent *e);
00030 void setWrong();
00031 void resetStyle();
00032
00033 private:
00034 void setBlackStyle();
00035 void setGreyHintStyle();
00036
00037 QString defaultText;
00038
00039
00040
00041 bool hintStyleActive:1;
00042 };
00043
00044 #endif // ACOMBOBOX_H