Bug 379036 - attendees icons not dhown
Summary: attendees icons not dhown
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: incidence editors (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-21 11:33 UTC by Martin Koller
Modified: 2017-07-13 07:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Koller 2017-04-21 11:33:24 UTC
Using the Oxygen Icon set, when I double click on an event and opening the Attendees tab, the columns Role, Status and Response are always blank (no icon shown), although when I click on any of the shown buttons, the dropdown menu shows all icons, so it's not an issue of missing icon files.
Comment 1 Laurent Montel 2017-05-10 11:21:32 UTC
Which korganizer version ?ยง
Comment 2 Martin Koller 2017-05-10 11:31:13 UTC
current from git (Version 5.5.40 alpha1) last compiled on 6.May
Comment 3 Allen Winter 2017-05-31 16:00:48 UTC
works fine for me.  no idea why this would be happening.
I'm using self-compiled from master.
Comment 4 Martin Koller 2017-05-31 18:16:17 UTC
And you're using Oxygen icons ?
Comment 5 Allen Winter 2017-05-31 19:16:38 UTC
no, Breeze.

I don't see how this could be a problem with KOrganizer itself.
Comment 6 Martin Koller 2017-07-13 06:33:48 UTC
Found the bug. When painting, the iconSize member of the style option struct was not set and defaults to an invalid size. I'm using Qt 5.9.1 if that matters.

This fixes it:

diff --git a/src/attendeecomboboxdelegate.cpp b/src/attendeecomboboxdelegate.cpp
index fe8c10f..f13be6d 100644
--- a/src/attendeecomboboxdelegate.cpp
+++ b/src/attendeecomboboxdelegate.cpp
@@ -126,6 +126,7 @@ void AttendeeComboBoxDelegate::paint(QPainter *painter, const QStyleOptionViewIt
     myOption.rect = option.rect;
     myOption.state = option.state;
     myOption.icon = mEntries[value].first;
+    myOption.iconSize = myOption.icon.actualSize(option.rect.size());

     QApplication::style()->drawControl(QStyle::CE_PushButton, &myOption, painter);
 }

Would this be ok to commit ?
Comment 7 Laurent Montel 2017-07-13 07:39:24 UTC
Wierd that they don't use copy constructor for creating QStyleOptionButton

but it seems logical.
Please commit it.

Thanks
Comment 8 Martin Koller 2017-07-13 07:45:56 UTC
Git commit 35440057afcd456f9e3640d3e9625b14df0fcd5a by Martin Koller.
Committed on 13/07/2017 at 07:44.
Pushed by mkoller into branch 'master'.

set iconSize fixing not shown icon

M  +1    -0    src/attendeecomboboxdelegate.cpp

https://commits.kde.org/incidenceeditor/35440057afcd456f9e3640d3e9625b14df0fcd5a
Comment 9 Martin Koller 2017-07-13 07:48:24 UTC
(In reply to Laurent Montel from comment #7)
> Wierd that they don't use copy constructor for creating QStyleOptionButton

not possible since given option is a QStyleOptionViewItem