Bug 265271

Summary: Oxygen crash when drawing custom QToolButton on QWidget (using QStyleOptionToolButton)
Product: [Plasma] Oxygen Reporter: Zeljan Rikalo <zeljko>
Component: generalAssignee: Hugo Pereira Da Costa <hugo.pereira.da.costa>
Status: RESOLVED FIXED    
Severity: crash CC: hugo.pereira.da.costa, rdieter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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