Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KAddressBook
Commits
ab8ba956
Commit
ab8ba956
authored
Sep 14, 2020
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't try to draw description if it"s empty
parent
f8d9b028
Pipeline
#34236
failed with stage
in 5 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
src/stylecontactlistdelegate.cpp
src/stylecontactlistdelegate.cpp
+5
-3
No files found.
src/stylecontactlistdelegate.cpp
View file @
ab8ba956
...
...
@@ -96,10 +96,12 @@ void StyleContactListDelegate::paint(QPainter *painter, const QStyleOptionViewIt
painter
->
drawText
(
nameTextRect
,
Qt
::
AlignLeft
|
Qt
::
AlignVCenter
,
painter
->
fontMetrics
().
elidedText
(
name
,
Qt
::
ElideRight
,
nameTextRect
.
width
()));
painter
->
setFont
(
QFont
(
option
.
font
.
family
(),
8
,
-
1
,
true
));
const
QString
description
=
index
.
data
(
ContactInfoProxyModel
::
Roles
::
DescriptionRole
).
value
<
QString
>
();
painter
->
drawText
(
descriptionTextRect
,
Qt
::
AlignLeft
|
Qt
::
AlignVCenter
,
painter
->
fontMetrics
().
elidedText
(
description
,
Qt
::
ElideRight
,
descriptionTextRect
.
width
()));
if
(
!
description
.
isEmpty
())
{
painter
->
setFont
(
QFont
(
option
.
font
.
family
(),
8
,
-
1
,
true
));
painter
->
drawText
(
descriptionTextRect
,
Qt
::
AlignLeft
|
Qt
::
AlignVCenter
,
painter
->
fontMetrics
().
elidedText
(
description
,
Qt
::
ElideRight
,
descriptionTextRect
.
width
()));
}
return
;
}
QStyledItemDelegate
::
paint
(
painter
,
option
,
index
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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