Fabcoin Core  0.16.2
P2P Digital Currency
addressfield.h
Go to the documentation of this file.
1 // Copyright (c) 2016-2017 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef ADDRESSFIELD_H
6 #define ADDRESSFIELD_H
7 
8 #include <QComboBox>
9 #include <QStringList>
10 #include <QStringListModel>
11 
12 
15 class AddressField: public QComboBox
16 {
17  Q_OBJECT
19 
20 public:
24  enum AddressType { UTXO };
25 
26  Q_ENUM(AddressType)
27 
28 
33  {
36  }
37 
43  {
44  return m_addressType;
45  }
46 
51  explicit AddressField(QWidget *parent = 0);
52 
57  virtual QString currentText() const;
58 
59  bool isValidAddress();
60  void setComboBoxEditable(bool editable);
61 
62  void setAddressTableModel(QAbstractItemModel *addressTableModel);
63 
64  void setAddressColumn(int addressColumn);
65 
66  void setTypeRole(int typeRole);
67 
68  void setReceive(const QString &receive);
69 
70 Q_SIGNALS:
75 
76 public Q_SLOTS:
80  void on_refresh();
81 
85  void on_addressTypeChanged();
86 
90  void on_editingFinished();
91 
92 private:
93  void appendAddress(const QString& strAddress);
94 
95 private:
96  QStringList m_stringList;
97  QStringListModel m_stringModel;
99  QAbstractItemModel* m_addressTableModel;
102  QString m_receive;
103 };
104 
105 #endif // ADDRESSFIELD_H
void setAddressColumn(int addressColumn)
void setTypeRole(int typeRole)
AddressType addressType() const
addressType Get the address type
Definition: addressfield.h:42
void setAddressTableModel(QAbstractItemModel *addressTableModel)
QString m_receive
Definition: addressfield.h:102
void appendAddress(const QString &strAddress)
Drop down list of addresses.
Definition: addressfield.h:15
AddressType m_addressType
Definition: addressfield.h:98
QStringListModel m_stringModel
Definition: addressfield.h:97
QStringList m_stringList
Definition: addressfield.h:96
void on_refresh()
on_refresh Refresh the list of addresses
QAbstractItemModel * m_addressTableModel
Definition: addressfield.h:99
void on_editingFinished()
on_editingFinished Completer finish text update
AddressField(QWidget *parent=0)
AddressField Constructor.
bool isValidAddress()
void addressTypeChanged(AddressType)
addressTypeChanged Signal that the address type is changed
void setReceive(const QString &receive)
void setAddressType(AddressType addressType)
setAddressType Set the address type
Definition: addressfield.h:32
void on_addressTypeChanged()
on_addressTypeChanged Change the address type
virtual QString currentText() const
currentText Get the current text
void setComboBoxEditable(bool editable)
AddressType
The AddressType enum Type of addresses that will be displayed.
Definition: addressfield.h:24