Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
5d2c5652
Commit
5d2c5652
authored
Feb 05, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Feb 05, 2022
Browse files
Remove sizeHint
parent
89b02a39
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/search/htmldelegate.cpp
View file @
5d2c5652
...
...
@@ -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
}
addons/search/htmldelegate.h
View file @
5d2c5652
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment