Anoncoin  0.9.4
P2P Digital Currency
qvalidatedlineedit.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Copyright (c) 2013-2014 The Anoncoin Core developers
3 // Distributed under the MIT/X11 software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef QVALIDATEDLINEEDIT_H
7 #define QVALIDATEDLINEEDIT_H
8 
9 #include <QLineEdit>
10 
14 class QValidatedLineEdit : public QLineEdit
15 {
16  Q_OBJECT
17 
18 public:
19  explicit QValidatedLineEdit(QWidget *parent);
20  void clear();
21  void setCheckValidator(const QValidator *v);
22 
23 protected:
24  void focusInEvent(QFocusEvent *evt);
25  void focusOutEvent(QFocusEvent *evt);
26 
27 private:
28  bool valid;
29  const QValidator *checkValidator;
30 
31 public slots:
32  void setValid(bool valid);
33  void setEnabled(bool enabled);
34 
35 private slots:
36  void markValid();
37  void checkValidity();
38 };
39 
40 #endif // QVALIDATEDLINEEDIT_H
Line edit that can be marked as "invalid" to show input validation feedback.
void focusInEvent(QFocusEvent *evt)
QValidatedLineEdit(QWidget *parent)
const QValidator * checkValidator
void focusOutEvent(QFocusEvent *evt)
void setCheckValidator(const QValidator *v)
void setEnabled(bool enabled)
void setValid(bool valid)