summaryrefslogtreecommitdiff
path: root/src/modcontenticondelegate.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2022-05-17 11:47:01 +0200
committerMikaël Capelle <capelle.mikael@gmail.com>2023-07-09 17:20:40 +0200
commitd13f6bb870cdda71257f665367be8ef9fca86255 (patch)
tree52e214718478f1e52856572f5aa1a2ac58537f9f /src/modcontenticondelegate.cpp
parent86bb01ba9eac879d3685c439ac9da0028bc4bc80 (diff)
Apply clang-format.
Diffstat (limited to 'src/modcontenticondelegate.cpp')
-rw-r--r--src/modcontenticondelegate.cpp27
1 files changed, 15 insertions, 12 deletions
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<QString> 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<QHelpEvent*>(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<QHelpEvent*>(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);
}
}