Bug 265271 - Oxygen crash when drawing custom QToolButton on QWidget (using QStyleOptionToolButton)
Summary: Oxygen crash when drawing custom QToolButton on QWidget (using QStyleOptionTo...
Status: RESOLVED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-03 11:30 UTC by Zeljan Rikalo
Modified: 2011-02-05 18:37 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zeljan Rikalo 2011-02-03 11:30:17 UTC
Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

oxygenstyle.cpp 
bool Style::drawIndicatorButtonDropDownPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const

crash line 3764 because tool is null (and there's no check if it's null).
if( tool->popupMode()==QToolButton::MenuButtonPopup )

So possible fix is
if (tool && tool->popupMode()==QToolButton::MenuButtonPopup )


Reproducible: Always

Steps to Reproduce:
Try to draw an CC_ToolButton on simple QWidget
Comment 1 Hugo Pereira Da Costa 2011-02-03 11:38:13 UTC
Hello Zeljan,
you're absolutely correct. 
Fixing now.
Sorry for the trouble.
Comment 2 Hugo Pereira Da Costa 2011-02-03 12:22:33 UTC
Git commit 375112824488df9a827a498b512eabeb5ce0deaf by Hugo Pereira Da Costa.
Committed on 03/02/11 at 11:44.
Pushed by hpereiradacosta into branch 'KDE/4.6'.

Check validity of QToolButton cast before testing popupMode()

BUG: 265271

M  +2    -2    kstyles/oxygen/oxygenstyle.cpp     

http://commits.kde.org/kde-workspace/375112824488df9a827a498b512eabeb5ce0deaf
Comment 3 Hugo Pereira Da Costa 2011-02-03 12:23:04 UTC
... I'll forward port to master as soon as I know how to do that.
Comment 4 Hugo Pereira Da Costa 2011-02-05 18:37:07 UTC
Git commit d0090b681db4f18730384c90ff018790b8d63ce9 by Hugo Pereira Da Costa.
Committed on 03/02/11 at 11:44.
Pushed by hpereiradacosta into branch 'master'.

Check validity of QToolButton cast before testing popupMode()

BUG: 265271

M  +2    -2    kstyles/oxygen/oxygenstyle.cpp     

http://commits.kde.org/kde-workspace/d0090b681db4f18730384c90ff018790b8d63ce9