From f5cfc36e3e47d59ebce8f6b8c6d75b2724e985c7 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Sun, 21 Oct 2018 15:48:41 +0200 Subject: [PATCH] qgraphicslayoutstyleinfo: Remove useless check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp b/src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp index af969b346d..8b4861bf45 100644 --- a/src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp +++ b/src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp @@ -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; }