File indexing completed on 2024-05-19 04:03:52
0001 /* -*- C++ -*- 0002 This file declares the SMIVItemDelegate class. 0003 0004 SPDX-FileCopyrightText: 2005 Mirko Boehm <mirko@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 0008 License: LGPL with the following explicit clarification: 0009 This code may be linked against any version of the Qt toolkit 0010 from Trolltech, Norway. 0011 0012 $Id: SMIVItemDelegate.h 30 2005-08-16 16:16:04Z mirko $ 0013 */ 0014 0015 #ifndef ITEMDELEGATE_H 0016 #define ITEMDELEGATE_H 0017 0018 #include <QItemDelegate> 0019 #include <QSize> 0020 0021 class ItemDelegate : public QItemDelegate 0022 { 0023 Q_OBJECT 0024 public: 0025 ItemDelegate(QObject *parent = nullptr); 0026 static const int FrameWidth; 0027 static const int TextMargin; 0028 static const int Margin; 0029 0030 private: 0031 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; 0032 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 0033 }; 0034 0035 #endif // SMIVITEMDELEGATE