| 1 |
/****************************************************************************** |
| 2 |
This source file is part of the Avogadro project. |
| 3 |
This source code is released under the 3-Clause BSD License, (see "LICENSE"). |
| 4 |
******************************************************************************/ |
| 5 |
|
| 6 |
#ifndef AVOGADRO_QTPLUGINS_RICHTEXTDELEGATE_H |
| 7 |
#define AVOGADRO_QTPLUGINS_RICHTEXTDELEGATE_H |
| 8 |
|
| 9 |
#include <QPainter> |
| 10 |
#include <QStyledItemDelegate> |
| 11 |
#include <QTextDocument> |
| 12 |
|
| 13 |
#include "avogadroqtguiexport.h" |
| 14 |
|
| 15 |
namespace Avogadro { |
| 16 |
namespace QtGui { |
| 17 |
|
| 18 |
class AVOGADROQTGUI_EXPORT RichTextDelegate : public QStyledItemDelegate |
| 19 |
{ |
| 20 |
Q_OBJECT |
| 21 |
|
| 22 |
public: |
| 23 |
explicit RichTextDelegate(QObject* parent = nullptr); |
| 24 |
~RichTextDelegate() override; |
| 25 |
|
| 26 |
QSize sizeHint(const QStyleOptionViewItem& o, |
| 27 |
const QModelIndex& index) const override; |
| 28 |
void paint(QPainter* p, const QStyleOptionViewItem& o, |
| 29 |
const QModelIndex& index) const override; |
| 30 |
}; |
| 31 |
|
| 32 |
} // namespace QtGui |
| 33 |
} // namespace Avogadro |
| 34 |
|
| 35 |
#endif // AVOGADRO_QTGUI_RICHTEXTDELEGATE_H |