mirror of
https://github.com/feather-wallet/feather.git
synced 2024-10-30 08:57:39 +00:00
Receive: show address index
This commit is contained in:
parent
b93d61a164
commit
371aef9de0
3 changed files with 11 additions and 4 deletions
|
@ -26,9 +26,9 @@ ReceiveWidget::ReceiveWidget(Wallet *wallet, QWidget *parent)
|
|||
|
||||
ui->addresses->setModel(m_proxyModel);
|
||||
ui->addresses->setColumnHidden(SubaddressModel::isUsed, true);
|
||||
ui->addresses->header()->setSectionResizeMode(SubaddressModel::Address, QHeaderView::Stretch);
|
||||
ui->addresses->header()->setSectionResizeMode(SubaddressModel::Label, QHeaderView::ResizeToContents);
|
||||
ui->addresses->header()->setMinimumSectionSize(200);
|
||||
ui->addresses->header()->setSectionResizeMode(SubaddressModel::Index, QHeaderView::ResizeToContents);
|
||||
ui->addresses->header()->setSectionResizeMode(SubaddressModel::Address, QHeaderView::ResizeToContents);
|
||||
ui->addresses->header()->setSectionResizeMode(SubaddressModel::Label, QHeaderView::Stretch);
|
||||
|
||||
connect(ui->addresses->selectionModel(), &QItemSelectionModel::currentChanged, [=](QModelIndex current, QModelIndex prev){
|
||||
this->updateQrCode();
|
||||
|
|
|
@ -96,6 +96,10 @@ QVariant SubaddressModel::data(const QModelIndex &index, int role) const
|
|||
QVariant SubaddressModel::parseSubaddressRow(const Monero::SubaddressRow &subaddress, const QModelIndex &index, int role) const
|
||||
{
|
||||
switch (index.column()) {
|
||||
case Index:
|
||||
{
|
||||
return "#" + QString::number(subaddress.getRowId());
|
||||
}
|
||||
case Address:
|
||||
{
|
||||
QString address = QString::fromStdString(subaddress.getAddress());
|
||||
|
@ -123,6 +127,8 @@ QVariant SubaddressModel::headerData(int section, Qt::Orientation orientation, i
|
|||
if (orientation == Qt::Horizontal)
|
||||
{
|
||||
switch(section) {
|
||||
case Index:
|
||||
return QString("#");
|
||||
case Address:
|
||||
return QString("Address");
|
||||
case Label:
|
||||
|
|
|
@ -19,7 +19,8 @@ class SubaddressModel : public QAbstractTableModel
|
|||
public:
|
||||
enum ModelColumn
|
||||
{
|
||||
Address = 0,
|
||||
Index = 0,
|
||||
Address,
|
||||
Label,
|
||||
isUsed,
|
||||
COUNT
|
||||
|
|
Loading…
Reference in a new issue