Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
qvalidatedlineedit.cpp
Go to the documentation of this file.
1 #include "qvalidatedlineedit.h"
2 
3 #include "guiconstants.h"
4 
6  QLineEdit(parent), valid(true)
7 {
8  connect(this, SIGNAL(textChanged(QString)), this, SLOT(markValid()));
9 }
10 
12 {
13  if(valid == this->valid)
14  {
15  return;
16  }
17 
18  if(valid)
19  {
20  setStyleSheet("");
21  }
22  else
23  {
24  setStyleSheet(STYLE_INVALID);
25  }
26  this->valid = valid;
27 }
28 
29 void QValidatedLineEdit::focusInEvent(QFocusEvent *evt)
30 {
31  // Clear invalid flag on focus
32  setValid(true);
33  QLineEdit::focusInEvent(evt);
34 }
35 
37 {
38  setValid(true);
39 }
40 
42 {
43  setValid(true);
44  QLineEdit::clear();
45 }
#define STYLE_INVALID
Definition: guiconstants.h:14
void focusInEvent(QFocusEvent *evt)
QValidatedLineEdit(QWidget *parent=0)
void setValid(bool valid)