Commit f0f268f9 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Use the editor font in search results

parent e32de667
......@@ -33,6 +33,7 @@ void SPHtmlDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option
initStyleOption(&options, index);
QTextDocument doc;
doc.setDefaultFont(m_font);
doc.setDocumentMargin(s_ItemMargin);
doc.setHtml(index.data().toString());
......
......@@ -9,15 +9,25 @@
#define HTML_DELEGATE_H
#include <QStyledItemDelegate>
#include <QFont>
class SPHtmlDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit SPHtmlDelegate(QObject *parent);
~SPHtmlDelegate() override;
void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
void setDisplayFont(const QFont& font)
{
m_font = font;
}
private:
QFont m_font;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment