Skip to content
Commit 037d2c99 authored by Anton Kreuzkamp's avatar Anton Kreuzkamp
Browse files

KItemListWidget: Use initStyleOption

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.
parent 6100f66a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment