Discussion:
D17330: KItemListWidget: Use QGraphicsWidget::initStyleOption instead of QStyleOption::initFrom
Anton Kreuzkamp
2018-12-03 14:26:08 UTC
Permalink
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
Anton Kreuzkamp
2018-12-03 14:34:27 UTC
Permalink
akreuzkamp added a comment.


related bug-report to GammaRay: https://github.com/KDAB/GammaRay/issues/504

REPOSITORY
R318 Dolphin

REVISION DETAIL
https://phabricator.kde.org/D17330

To: akreuzkamp, #dolphin
Cc: kfm-devel, alexde, sourabhboss, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
Elvis Angelaccio
2018-12-03 21:03:11 UTC
Permalink
elvisangelaccio accepted this revision.
elvisangelaccio added a comment.
This revision is now accepted and ready to land.


Thanks

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

REPOSITORY
R318 Dolphin

REVISION DETAIL
https://phabricator.kde.org/D17330

To: akreuzkamp, #dolphin, elvisangelaccio
Cc: elvisangelaccio, kfm-devel, alexde, sourabhboss, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
Anton Kreuzkamp
2018-12-04 08:52:37 UTC
Permalink
akreuzkamp closed this revision.
akreuzkamp added a comment.


Pushed it, thanks for the review.
https://commits.kde.org/dolphin/037d2c9984880065bf8a7e5d189aac1c670e531b

REPOSITORY
R318 Dolphin

REVISION DETAIL
https://phabricator.kde.org/D17330

To: akreuzkamp, #dolphin, elvisangelaccio
Cc: elvisangelaccio, kfm-devel, alexde, sourabhboss, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
Loading...