Anton Kreuzkamp
2018-12-03 14:26:08 UTC
akreuzkamp created this revision.
akreuzkamp added a reviewer: Dolphin.
akreuzkamp added a project: Dolphin.
Herald added a subscriber: kfm-devel.
akreuzkamp requested review of this revision.
REVISION 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.
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D17330
AFFECTED FILES
src/kitemviews/kitemlistview.cpp
src/kitemviews/kitemlistwidget.cpp
To: akreuzkamp, #dolphin
Cc: kfm-devel, alexde, sourabhboss, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
akreuzkamp added a reviewer: Dolphin.
akreuzkamp added a project: Dolphin.
Herald added a subscriber: kfm-devel.
akreuzkamp requested review of this revision.
REVISION 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.
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D17330
AFFECTED FILES
src/kitemviews/kitemlistview.cpp
src/kitemviews/kitemlistwidget.cpp
To: akreuzkamp, #dolphin
Cc: kfm-devel, alexde, sourabhboss, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov