File indexing completed on 2024-04-14 15:51:36

0001 /***************************************************************************
0002                      richtextitemdelegate.h  -  description
0003                              -------------------
0004     begin                : Mon Oct 12 2009
0005     copyright            : (C) 2009 by Dominik Seichter
0006     email                : domseichter@web.de
0007 ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #ifndef RICHTEXT_ITEM_DELEGATE_H
0019 #define RICHTEXT_ITEM_DELEGATE_H
0020 
0021 #include <QItemDelegate>
0022 
0023 class QTextDocument;
0024 
0025 class RichTextItemDelegate : public QItemDelegate
0026 {
0027 
0028 public:
0029     explicit RichTextItemDelegate(QObject *parent = nullptr);
0030     virtual ~RichTextItemDelegate() { }
0031 
0032     virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
0033     virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
0034 
0035 private:
0036     QTextDocument *m_document;
0037 
0038 };
0039 
0040 #endif // RICHTEXT_ITEM_DELEGATE_H