PIVX Core  5.6.99
P2P Digital Currency
addressholder.h
Go to the documentation of this file.
1 // Copyright (c) 2019 The PIVX 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 PIVX_QT_ADDRESSHOLDER_H
6 #define PIVX_QT_ADDRESSHOLDER_H
7 
8 #include "furlistrow.h"
9 #include "guiutil.h"
10 #include "myaddressrow.h"
11 #include <QColor>
12 #include <QWidget>
13 
14 
15 class AddressHolder : public FurListRow<QWidget*>
16 {
17 public:
19 
20  explicit AddressHolder(bool _isLightTheme) : FurListRow(), isLightTheme(_isLightTheme){}
21 
22  MyAddressRow* createHolder(int pos) override{
23  if (!cachedRow) cachedRow = new MyAddressRow();
24  return cachedRow;
25  }
26 
27  void init(QWidget* holder,const QModelIndex &index, bool isHovered, bool isSelected) const override;
28 
29  QColor rectColor(bool isHovered, bool isSelected) override;
30 
31  ~AddressHolder() override {
32  if (cachedRow)
33  delete cachedRow;
34  }
35 
37  MyAddressRow* cachedRow = nullptr;
38 };
39 
40 
41 #endif // PIVX_QT_ADDRESSHOLDER_H
void init(QWidget *holder, const QModelIndex &index, bool isHovered, bool isSelected) const override
QColor rectColor(bool isHovered, bool isSelected) override
MyAddressRow * createHolder(int pos) override
Definition: addressholder.h:22
MyAddressRow * cachedRow
Definition: addressholder.h:37
AddressHolder(bool _isLightTheme)
Definition: addressholder.h:20
~AddressHolder() override
Definition: addressholder.h:31