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"
|
2024-03-08 16:35:57 +00:00
|
|
|
#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();
|
2024-03-08 16:35:57 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|