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

Authored by akreuzkamp on Dec 3 2018, 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.Dec 3 2018, 2:26 PM
Restricted Application added a subscriber: kfm-devel. ยท View Herald TranscriptDec 3 2018, 2:26 PM
akreuzkamp requested review of this revision.Dec 3 2018, 2:26 PM
elvisangelaccio accepted this revision.Dec 3 2018, 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.Dec 3 2018, 9:03 PM