qgraphicslayoutstyleinfo: Remove useless check

There is no sense in testing the 'm_widget' pointer against null, as the
memory was allocated using the 'new' operator. The exception will be
generated in the case of memory allocation error.

Task-number: QTBUG-71156
Change-Id: I898bac6d9b51b2abd7a5311aa71ac2492c7c042c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
bb10
Ivan Komissarov 2018-10-21 15:48:41 +02:00
parent 4c58569085
commit f5cfc36e3e
1 changed files with 1 additions and 2 deletions

View File

@ -51,8 +51,7 @@ QGraphicsLayoutStyleInfo::QGraphicsLayoutStyleInfo(const QGraphicsLayoutPrivate
: m_layout(layout), m_style(0)
{
m_widget = new QWidget; // pixelMetric might need a widget ptr
if (m_widget)
m_styleOption.initFrom(m_widget);
m_styleOption.initFrom(m_widget);
m_isWindow = m_styleOption.state & QStyle::State_Window;
}