Raven Core  3.0.0
P2P Digital Currency
qvalidatedlineedit.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2015 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef RAVEN_QT_QVALIDATEDLINEEDIT_H
7 #define RAVEN_QT_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  bool isValid();
23 
24 protected:
25  void focusInEvent(QFocusEvent *evt);
26  void focusOutEvent(QFocusEvent *evt);
27 
28 private:
29  bool valid;
30  const QValidator *checkValidator;
31 
32 public Q_SLOTS:
33  void setValid(bool valid);
34  void setEnabled(bool enabled);
35 
36 Q_SIGNALS:
37  void validationDidChange(QValidatedLineEdit *validatedLineEdit);
38 
39 private Q_SLOTS:
40  void markValid();
41  void checkValidity();
42 };
43 
44 #endif // RAVEN_QT_QVALIDATEDLINEEDIT_H
Line edit that can be marked as "invalid" to show input validation feedback.
void validationDidChange(QValidatedLineEdit *validatedLineEdit)
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)