BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ItemDelegateForHTML.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Tool/ItemDelegateForHTML.h
6 //! @brief Defines class ItemDelegateForHTML
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_VIEW_TOOL_ITEMDELEGATEFORHTML_H
16 #define BORNAGAIN_GUI_VIEW_TOOL_ITEMDELEGATEFORHTML_H
17 
18 #include <QStyledItemDelegate>
19 
20 //! For representing HTML text in an item */
21 class ItemDelegateForHTML : public QStyledItemDelegate {
22 public:
23  ItemDelegateForHTML(QObject* parent);
24 
25  QString anchorAtGlobalPos(QAbstractItemView* view, const QModelIndex& index,
26  const QPoint& globalPos) const;
27 
28 protected:
29  void paint(QPainter* painter, const QStyleOptionViewItem& option,
30  const QModelIndex& index) const override;
31  QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override;
32 
33 private:
34  static QSize sizeHint(const QString& text);
35 };
36 
37 
38 #endif // BORNAGAIN_GUI_VIEW_TOOL_ITEMDELEGATEFORHTML_H
For representing HTML text in an item *‍/.
ItemDelegateForHTML(QObject *parent)
QString anchorAtGlobalPos(QAbstractItemView *view, const QModelIndex &index, const QPoint &globalPos) const
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override