Check for option->styleObject before accessing it

BUG: 395028
FIXED-IN: 5.13.0

Differential Revision: https://phabricator.kde.org/D13336
wilder-5.17
Kai Uwe Broulik 8 years ago
parent 171efb4a34
commit 6d886e9f75
  1. 4
      kstyle/breezestyle.cpp

@ -5038,7 +5038,9 @@ namespace Breeze
//try to understand if anywhere the widget is under mouse, not just the handle, use _animations in case of QWidget, option->styleObject in case of QML
#if QT_VERSION >= 0x050000
const bool widgetMouseOver( widget ? _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ) : option->styleObject->property("hover").toBool());
bool widgetMouseOver( ( option->state & State_MouseOver ) );
if( widget ) widgetMouseOver = _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove );
else if( option->styleObject ) widgetMouseOver = option->styleObject->property("hover").toBool();
#else
const bool widgetMouseOver( _animations->scrollBarEngine().isHovered( widget, QStyle::SC_ScrollBarGroove ) );
#endif

Loading…
Cancel
Save