mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-23 03:59:29 +00:00
Merge pull request 'Receive: always copy full address' (#41) from tobtoht/feather:receive_copy into master
Reviewed-on: https://git.wownero.com/feather/feather/pulls/41
This commit is contained in:
commit
12940361d8
3 changed files with 45 additions and 1 deletions
20
src/model/SubaddressView.cpp
Normal file
20
src/model/SubaddressView.cpp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#include "SubaddressView.h"
|
||||||
|
|
||||||
|
#include "model/ModelUtils.h"
|
||||||
|
|
||||||
|
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();
|
||||||
|
ModelUtils::copyColumn(&index, index.column());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
QTreeView::keyPressEvent(event);
|
||||||
|
}
|
||||||
|
}
|
19
src/model/SubaddressView.h
Normal file
19
src/model/SubaddressView.h
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#ifndef FEATHER_SUBADDRESSVIEW_H
|
||||||
|
#define FEATHER_SUBADDRESSVIEW_H
|
||||||
|
|
||||||
|
#include <QTreeView>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QClipboard>
|
||||||
|
|
||||||
|
class SubaddressView : public QTreeView
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubaddressView(QWidget* parent = nullptr);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //FEATHER_SUBADDRESSVIEW_H
|
|
@ -42,7 +42,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTreeView" name="addresses">
|
<widget class="SubaddressView" name="addresses">
|
||||||
<property name="horizontalScrollBarPolicy">
|
<property name="horizontalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
</property>
|
</property>
|
||||||
|
@ -101,6 +101,11 @@
|
||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
<header>components.h</header>
|
<header>components.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>SubaddressView</class>
|
||||||
|
<extends>QTreeView</extends>
|
||||||
|
<header>model/SubaddressView.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
Loading…
Reference in a new issue