forked from qt-creator/qt-creator
ManhattanStyle: Validate widget before dereferencing
Change-Id: Id32e59f96ed8a94f08eb0effbca4918e11659c06 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
bf31eb5195
commit
65ee566183
@@ -789,11 +789,12 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
|||||||
bool horizontal = option->state & State_Horizontal;
|
bool horizontal = option->state & State_Horizontal;
|
||||||
|
|
||||||
// Map offset for global window gradient
|
// Map offset for global window gradient
|
||||||
QPoint offset = widget->window()->mapToGlobal(option->rect.topLeft()) -
|
|
||||||
widget->mapToGlobal(option->rect.topLeft());
|
|
||||||
QRect gradientSpan;
|
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());
|
gradientSpan = QRect(offset, widget->window()->size());
|
||||||
|
}
|
||||||
|
|
||||||
bool drawLightColored = lightColored(widget);
|
bool drawLightColored = lightColored(widget);
|
||||||
if (horizontal)
|
if (horizontal)
|
||||||
|
|||||||
Reference in New Issue
Block a user