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

Remove sizeHint

parent 89b02a39
......@@ -185,13 +185,3 @@ void SPHtmlDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option
painter->restore();
}
}
QSize SPHtmlDelegate::sizeHint(const QStyleOptionViewItem & /*option*/, const QModelIndex &index) const
{
QTextDocument doc;
doc.setDefaultFont(m_font);
doc.setDocumentMargin(s_ItemMargin);
doc.setHtml(index.data().toString());
// qDebug() << doc.toPlainText() << doc.size().toSize();
return doc.size().toSize() + QSize(30, 0); // add margin for the check-box
}
......@@ -18,7 +18,6 @@ public:
explicit SPHtmlDelegate(QObject *parent);
void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
private:
void paintMatchItem(QPainter *, const QStyleOptionViewItem &, const QModelIndex &index) const;
......
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