diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-12 20:34:02 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-13 09:17:05 +0100 |
| commit | f32e74c2a78ae2fea6c1f825900287202778bf59 (patch) | |
| tree | ce0a1a726859a5a2c4ec1a57549b853217bd6f24 /src/copyeventfilter.cpp | |
| parent | 9e663691b0ad23faa979361facb416b7ea0fb08d (diff) | |
Allow extended selection in log list and implement copy.
Diffstat (limited to 'src/copyeventfilter.cpp')
| -rw-r--r-- | src/copyeventfilter.cpp | 6 |
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) { |
