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/modcontenticondelegate.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/modcontenticondelegate.cpp') diff --git a/src/modcontenticondelegate.cpp b/src/modcontenticondelegate.cpp index 57a4dc6d..c2c88933 100644 --- a/src/modcontenticondelegate.cpp +++ b/src/modcontenticondelegate.cpp @@ -2,10 +2,10 @@ #include "modlistview.h" -ModContentIconDelegate::ModContentIconDelegate(ModListView* view, int column, int compactSize) - : IconDelegate(view, column, compactSize), m_view(view) -{ -} +ModContentIconDelegate::ModContentIconDelegate(ModListView* view, int column, + int compactSize) + : IconDelegate(view, column, compactSize), m_view(view) +{} QList ModContentIconDelegate::getIcons(const QModelIndex& index) const { @@ -30,8 +30,9 @@ size_t ModContentIconDelegate::getNumIcons(const QModelIndex& index) const return getIcons(index).size(); } -bool ModContentIconDelegate::helpEvent( - QHelpEvent* event, QAbstractItemView* view, const QStyleOptionViewItem& option, const QModelIndex& index) +bool ModContentIconDelegate::helpEvent(QHelpEvent* event, QAbstractItemView* view, + const QStyleOptionViewItem& option, + const QModelIndex& index) { if (!event || !view) { return false; @@ -39,19 +40,21 @@ bool ModContentIconDelegate::helpEvent( if (event->type() == QEvent::ToolTip) { // this code is from QAbstractItemDelegate::helpEvent, only the the way // text is retrieved has been changed - QHelpEvent* he = static_cast(event); - const int precision = inherits("QItemDelegate") ? 10 : 6; // keep in sync with DBL_DIG in qitemdelegate.cpp - const QString tooltip = index.isValid() ? m_view->contentsTooltip(index) : QString(); + QHelpEvent* he = static_cast(event); + const int precision = inherits("QItemDelegate") + ? 10 + : 6; // keep in sync with DBL_DIG in qitemdelegate.cpp + const QString tooltip = + index.isValid() ? m_view->contentsTooltip(index) : QString(); QRect rect; if (index.isValid()) { const QRect r = view->visualRect(index); - rect = QRect(view->mapToGlobal(r.topLeft()), r.size()); + rect = QRect(view->mapToGlobal(r.topLeft()), r.size()); } QToolTip::showText(he->globalPos(), tooltip, view, rect); event->setAccepted(!tooltip.isEmpty()); return true; - } - else { + } else { return IconDelegate::helpEvent(event, view, option, index); } } -- cgit v1.3.1