File indexing completed on 2024-03-24 04:05:09
0001 /*************************************************************************** 0002 * Copyright (C) 2013 by Ian Simpson <ian.kdedev@yahoo.com> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify * 0005 * it under the terms of the GNU General Public License as published by * 0006 * the Free Software Foundation; either version 2 of the License, or * 0007 * (at your option) any later version. * 0008 ***************************************************************************/ 0009 0010 #ifndef ITEMDELEGATE_H 0011 #define ITEMDELEGATE_H 0012 0013 #include <QItemDelegate> 0014 0015 class itemDelegate : public QItemDelegate 0016 { 0017 Q_OBJECT 0018 public: 0019 explicit itemDelegate(int height, QObject *parent = nullptr); 0020 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; 0021 0022 void setHeight(int height); 0023 0024 private: 0025 QList<int> m_emptyRows; 0026 0027 int m_height; 0028 const int m_grandTotalRow; 0029 }; 0030 0031 #endif // ITEMDELEGATE_H