PIVX Core  5.6.99
P2P Digital Currency
addressholder.cpp
Go to the documentation of this file.
1 // Copyright (c) 2019-2020 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 #include "addressholder.h"
6 #include "qtutils.h"
7 
8 void AddressHolder::init(QWidget* holder,const QModelIndex &index, bool isHovered, bool isSelected) const {
9  MyAddressRow *row = static_cast<MyAddressRow*>(holder);
10  QString address = index.data(Qt::DisplayRole).toString();
12  address = address.left(22) + "..." + address.right(22);
13  }
14  QString label = index.sibling(index.row(), AddressTableModel::Label).data(Qt::DisplayRole).toString();
15  uint time = index.sibling(index.row(), AddressTableModel::Date).data(Qt::DisplayRole).toUInt();
16  QString date = (time == 0) ? "" : GUIUtil::dateTimeStr(QDateTime::fromTime_t(time));
17  row->updateView(address, label, date);
18 }
19 
20 QColor AddressHolder::rectColor(bool isHovered, bool isSelected) {
21  return getRowColor(isLightTheme, isHovered, isSelected);
22 }
void init(QWidget *holder, const QModelIndex &index, bool isHovered, bool isSelected) const override
QColor rectColor(bool isHovered, bool isSelected) override
@ TypeRole
Type of address (Send, Receive, ColdStaking, ColdStakingSend, Delegator, Delegable)
@ Label
User specified label.
@ Date
Address creation date.
static const QString ShieldedReceive
Specifies shielded send address.
void updateView(const QString &address, const QString &label, const QString &date)
QString dateTimeStr(const QDateTime &date)
Definition: guiutil.cpp:69
QColor getRowColor(bool isLightTheme, bool isHovered, bool isSelected)
Definition: qtutils.cpp:233