summaryrefslogtreecommitdiff
path: root/src/copyeventfilter.cpp
diff options
context:
space:
mode:
authorMikaƫl Capelle <capelle.mikael@gmail.com>2021-01-13 12:10:53 +0100
committerGitHub <noreply@github.com>2021-01-13 12:10:53 +0100
commit8338ea6ff42fcbc8b2475b8504d98e02b11a7d75 (patch)
treece0a1a726859a5a2c4ec1a57549b853217bd6f24 /src/copyeventfilter.cpp
parent9e663691b0ad23faa979361facb416b7ea0fb08d (diff)
parentf32e74c2a78ae2fea6c1f825900287202778bf59 (diff)
Merge pull request #1358 from Holt59/loglist-copy
Allow extended selection in log list and implement copy.
Diffstat (limited to 'src/copyeventfilter.cpp')
-rw-r--r--src/copyeventfilter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/copyeventfilter.cpp b/src/copyeventfilter.cpp
index 223561b0..bd61e04d 100644
--- a/src/copyeventfilter.cpp
+++ b/src/copyeventfilter.cpp
@@ -4,8 +4,8 @@
#include <QGuiApplication>
#include <QKeyEvent>
-CopyEventFilter::CopyEventFilter(QAbstractItemView* view, int role) :
- CopyEventFilter(view, [=](auto& index) { return index.data(role).toString(); })
+CopyEventFilter::CopyEventFilter(QAbstractItemView* view, int column, int role) :
+ CopyEventFilter(view, [=](auto& index) { return index.sibling(index.row(), column).data(role).toString(); })
{
}
@@ -27,7 +27,7 @@ void CopyEventFilter::copySelection() const
QModelIndexList selectedRows = m_view->selectionModel()->selectedRows();
std::sort(selectedRows.begin(), selectedRows.end(), [=](const auto& lidx, const auto& ridx) {
return m_view->visualRect(lidx).top() < m_view->visualRect(ridx).top();
- });
+ });
QStringList rows;
for (auto& idx : selectedRows) {