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

Anton Kreuzkamp noreply at phabricator.kde.org
Mon Dec 3 14:26:08 GMT 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20181203/9ddd6e46/attachment.htm>


More information about the kfm-devel mailing list