From f32e74c2a78ae2fea6c1f825900287202778bf59 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Tue, 12 Jan 2021 20:34:02 +0100 Subject: Allow extended selection in log list and implement copy. --- src/copyeventfilter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/copyeventfilter.cpp') 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 #include -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) { -- cgit v1.3.1