ManhattanStyle: Validate widget before dereferencing

Change-Id: Id32e59f96ed8a94f08eb0effbca4918e11659c06
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Orgad Shaneh
2014-05-06 00:04:22 +03:00
committed by Orgad Shaneh
parent bf31eb5195
commit 65ee566183

View File

@@ -789,11 +789,12 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
bool horizontal = option->state & State_Horizontal;
// Map offset for global window gradient
QPoint offset = widget->window()->mapToGlobal(option->rect.topLeft()) -
widget->mapToGlobal(option->rect.topLeft());
QRect gradientSpan;
if (widget)
if (widget) {
QPoint offset = widget->window()->mapToGlobal(option->rect.topLeft()) -
widget->mapToGlobal(option->rect.topLeft());
gradientSpan = QRect(offset, widget->window()->size());
}
bool drawLightColored = lightColored(widget);
if (horizontal)