KItemListWidget: Use QGraphicsWidget::initStyleOption instead of QStyleOption::initFrom
ClosedPublic

Authored by akreuzkamp on Mon, Dec 3, 2:26 PM.

Details

Reviewers
elvisangelaccio
Group Reviewers
Dolphin
Summary

Instead of using QStyleOption::initFrom, let's use
QGraphicsWidget::initStyleOption, which is made for exactly the purpose
of KItemListWidget. This is especially important since, according to the
docs of QGraphicsItem::paint "The widget argument is optional. [...]
For cached painting, widget is always 0.". Even though currently no code
in dolphin does cached painting, for the sake of modularity one should
not rely on widget to be non-null. Using QStyleOption::initFrom does
assume that, though.

In fact, GammaRay asks the items to do cached painting when attaching it
to the application, causing it to crash.

Diff Detail

Repository
R318 Dolphin
Lint
Lint Skipped
Unit
Unit Tests Skipped
akreuzkamp created this revision.Mon, Dec 3, 2:26 PM
Restricted Application added a subscriber: kfm-devel. · View Herald TranscriptMon, Dec 3, 2:26 PM
akreuzkamp requested review of this revision.Mon, Dec 3, 2:26 PM
elvisangelaccio accepted this revision.Mon, Dec 3, 9:03 PM
elvisangelaccio added a subscriber: elvisangelaccio.

Thanks

Can you please push it to the stable branch? (Applications/18.12)

This revision is now accepted and ready to land.Mon, Dec 3, 9:03 PM