From d13f6bb870cdda71257f665367be8ef9fca86255 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Tue, 17 May 2022 11:47:01 +0200 Subject: Apply clang-format. --- src/copyeventfilter.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'src/copyeventfilter.cpp') diff --git a/src/copyeventfilter.cpp b/src/copyeventfilter.cpp index bd61e04d..cee574c3 100644 --- a/src/copyeventfilter.cpp +++ b/src/copyeventfilter.cpp @@ -4,18 +4,16 @@ #include #include -CopyEventFilter::CopyEventFilter(QAbstractItemView* view, int column, int role) : - CopyEventFilter(view, [=](auto& index) { return index.sibling(index.row(), column).data(role).toString(); }) -{ - -} +CopyEventFilter::CopyEventFilter(QAbstractItemView* view, int column, int role) + : CopyEventFilter(view, [=](auto& index) { + return index.sibling(index.row(), column).data(role).toString(); + }) +{} -CopyEventFilter::CopyEventFilter( - QAbstractItemView* view, std::function format) : - QObject(view), m_view(view), m_format(format) -{ - -} +CopyEventFilter::CopyEventFilter(QAbstractItemView* view, + std::function format) + : QObject(view), m_view(view), m_format(format) +{} void CopyEventFilter::copySelection() const { @@ -25,9 +23,10 @@ void CopyEventFilter::copySelection() const // sort to reflect the visual order 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(); - }); + 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) { @@ -41,8 +40,7 @@ bool CopyEventFilter::eventFilter(QObject* sender, QEvent* event) { if (sender == m_view && event->type() == QEvent::KeyPress) { QKeyEvent* keyEvent = static_cast(event); - if (keyEvent->modifiers() == Qt::ControlModifier - && keyEvent->key() == Qt::Key_C) { + if (keyEvent->modifiers() == Qt::ControlModifier && keyEvent->key() == Qt::Key_C) { copySelection(); return true; } -- cgit v1.3.1