File indexing completed on 2024-06-16 04:47:25
0001 /*************************************************************************** 0002 * SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr 0003 * SPDX-FileCopyrightText: 2022 G. DE BURE support@mankowski.fr 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 ***************************************************************************/ 0006 #ifndef SKGBUDGETDELEGATE_H 0007 #define SKGBUDGETDELEGATE_H 0008 /** @file 0009 * This file is a delegate for budget. 0010 * 0011 * @author Stephane MANKOWSKI / Guillaume DE BURE 0012 */ 0013 #include <qstyleditemdelegate.h> 0014 0015 class SKGDocument; 0016 0017 /** 0018 * This file is a delegate for budget 0019 */ 0020 class SKGBudgetDelegate : public QStyledItemDelegate 0021 { 0022 Q_OBJECT 0023 public: 0024 /** 0025 * Default Constructor 0026 */ 0027 explicit SKGBudgetDelegate(QObject* iParent, SKGDocument* iDoc); 0028 0029 /** 0030 * Default Destructor 0031 */ 0032 ~SKGBudgetDelegate() override; 0033 0034 0035 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; 0036 0037 0038 private: 0039 Q_DISABLE_COPY(SKGBudgetDelegate) 0040 0041 SKGDocument* m_document; 0042 QString m_negativeStyleSheet; 0043 QString m_neutralStyleSheet; 0044 QString m_positiveStyleSheet; 0045 }; 0046 0047 #endif // SKGBUDGETDELEGATE_H