forked from qt-creator/qt-creator
FancyLineEdit: Use static initializers
Change-Id: Ifd3eee165b03ae6e4868911d039f503d9bbd13b8 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -90,46 +90,41 @@ public:
|
|||||||
virtual bool eventFilter(QObject *obj, QEvent *event);
|
virtual bool eventFilter(QObject *obj, QEvent *event);
|
||||||
|
|
||||||
FancyLineEdit *m_lineEdit;
|
FancyLineEdit *m_lineEdit;
|
||||||
|
IconButton *m_iconbutton[2];
|
||||||
|
HistoryCompleter *m_historyCompleter = 0;
|
||||||
|
FancyLineEdit::ValidationFunction m_validationFunction = &FancyLineEdit::validateWithValidator;
|
||||||
QString m_oldText;
|
QString m_oldText;
|
||||||
QPixmap m_pixmap[2];
|
QPixmap m_pixmap[2];
|
||||||
QMenu *m_menu[2];
|
QMenu *m_menu[2];
|
||||||
|
FancyLineEdit::State m_state = FancyLineEdit::Invalid;
|
||||||
bool m_menuTabFocusTrigger[2];
|
bool m_menuTabFocusTrigger[2];
|
||||||
IconButton *m_iconbutton[2];
|
|
||||||
bool m_iconEnabled[2];
|
bool m_iconEnabled[2];
|
||||||
|
|
||||||
HistoryCompleter *m_historyCompleter;
|
bool m_isFiltering = false;
|
||||||
FancyLineEdit::ValidationFunction m_validationFunction;
|
bool m_firstChange = false;
|
||||||
|
|
||||||
bool m_isFiltering;
|
|
||||||
QString m_lastFilterText;
|
QString m_lastFilterText;
|
||||||
|
|
||||||
const QColor m_okTextColor;
|
const QColor m_okTextColor;
|
||||||
QColor m_errorTextColor;
|
QColor m_errorTextColor = Qt::red;
|
||||||
FancyLineEdit::State m_state;
|
|
||||||
QString m_errorMessage;
|
QString m_errorMessage;
|
||||||
QString m_initialText;
|
QString m_initialText;
|
||||||
bool m_firstChange;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
FancyLineEditPrivate::FancyLineEditPrivate(FancyLineEdit *parent) :
|
FancyLineEditPrivate::FancyLineEditPrivate(FancyLineEdit *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
m_lineEdit(parent),
|
m_lineEdit(parent),
|
||||||
m_historyCompleter(0),
|
m_okTextColor(FancyLineEdit::textColor(parent))
|
||||||
m_validationFunction(FancyLineEdit::defaultValidationFunction()),
|
|
||||||
m_isFiltering(false),
|
|
||||||
m_okTextColor(FancyLineEdit::textColor(parent)),
|
|
||||||
m_errorTextColor(Qt::red),
|
|
||||||
m_state(FancyLineEdit::Invalid),
|
|
||||||
m_firstChange(true)
|
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
m_menu[i] = 0;
|
|
||||||
m_menuTabFocusTrigger[i] = false;
|
|
||||||
m_iconbutton[i] = new IconButton(parent);
|
m_iconbutton[i] = new IconButton(parent);
|
||||||
m_iconbutton[i]->installEventFilter(this);
|
m_iconbutton[i]->installEventFilter(this);
|
||||||
m_iconbutton[i]->hide();
|
m_iconbutton[i]->hide();
|
||||||
m_iconbutton[i]->setAutoHide(false);
|
m_iconbutton[i]->setAutoHide(false);
|
||||||
|
|
||||||
|
m_menu[i] = 0;
|
||||||
|
|
||||||
|
m_menuTabFocusTrigger[i] = false;
|
||||||
m_iconEnabled[i] = false;
|
m_iconEnabled[i] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user