feather/src/model/SubaddressView.cpp

29 lines
801 B
C++
Raw Normal View History

2020-12-26 19:56:06 +00:00
// SPDX-License-Identifier: BSD-3-Clause
2024-01-01 17:07:58 +00:00
// SPDX-FileCopyrightText: 2020-2024 The Monero Project
2020-12-26 19:56:06 +00:00
2020-10-11 15:23:13 +00:00
#include "SubaddressView.h"
2023-03-28 20:42:12 +00:00
#include "utils/Utils.h"
#include "SubaddressModel.h"
2020-10-11 15:23:13 +00:00
SubaddressView::SubaddressView(QWidget *parent) : QTreeView(parent) {
}
void SubaddressView::keyPressEvent(QKeyEvent *event){
QModelIndexList selectedRows = selectionModel()->selectedRows();
if(!selectedIndexes().isEmpty()){
if(event->matches(QKeySequence::Copy)){
QModelIndex index = this->currentIndex();
if (index.column() == SubaddressModel::ModelColumn::Address) {
emit copyAddress();
} else {
Utils::copyColumn(&index, index.column());
}
2020-10-11 15:23:13 +00:00
}
else
QTreeView::keyPressEvent(event);
}
}