From 67e5ac0aa51db4fd52da786a6227c8bc649814e5 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Wed, 2 Apr 2025 21:14:20 -0400 Subject: Add context menu for shared cache view. Also addresses some lints that I thought were possibly worth it. --- view/sharedcache/ui/dsctriage.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'view/sharedcache/ui/dsctriage.h') diff --git a/view/sharedcache/ui/dsctriage.h b/view/sharedcache/ui/dsctriage.h index edab8358..ae49bc8e 100644 --- a/view/sharedcache/ui/dsctriage.h +++ b/view/sharedcache/ui/dsctriage.h @@ -23,7 +23,7 @@ class AddressColorDelegate : public QStyledItemDelegate { public: - AddressColorDelegate(QObject* parent = nullptr) : QStyledItemDelegate(parent) {} + explicit AddressColorDelegate(QObject* parent = nullptr) : QStyledItemDelegate(parent) {} void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override { @@ -101,7 +101,7 @@ public: bool eventFilter(QObject* obj, QEvent* event) override { if (event->type() == QEvent::KeyPress) { - QKeyEvent* keyEvent = static_cast(event); + auto* keyEvent = dynamic_cast(event); if (keyEvent->key() == Qt::Key_Escape) { clearSelection(); return true; @@ -161,7 +161,10 @@ public: class LoadedDelegate : public QItemDelegate { Q_OBJECT + public: + explicit LoadedDelegate(QObject* parent = nullptr) : QItemDelegate(parent) {} + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override { @@ -202,7 +205,7 @@ public: { Q_UNUSED(option); Q_UNUSED(index); - return QSize(50, 24); + return {50, 24}; } void setEditorData(QWidget *editor, const QModelIndex &index) const override -- cgit v1.3.1