File indexing completed on 2024-05-19 05:44:23
0001 /* 0002 SPDX-FileCopyrightText: 2016-2019 Milian Wolff <mail@milianw.de> 0003 0004 SPDX-License-Identifier: LGPL-2.1-or-later 0005 */ 0006 0007 #ifndef COSTDELEGATE_H 0008 #define COSTDELEGATE_H 0009 0010 #include <QStyledItemDelegate> 0011 0012 class CostDelegate : public QStyledItemDelegate 0013 { 0014 Q_OBJECT 0015 public: 0016 explicit CostDelegate(int sortRole, int maxCostRole, QObject* parent = nullptr); 0017 ~CostDelegate(); 0018 0019 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; 0020 0021 private: 0022 int m_sortRole = -1; 0023 int m_maxCostRole = -1; 0024 }; 0025 0026 #endif // COSTDELEGATE_H