diff options
author | Ivan Komissarov <ABBAPOH@gmail.com> | 2018-10-21 15:48:41 +0200 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2018-12-04 08:45:18 +0000 |
commit | f5cfc36e3e47d59ebce8f6b8c6d75b2724e985c7 (patch) | |
tree | 9ebcc1b4e6301ad68efcc4ce53b2c66a18db5a74 /src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp | |
parent | 4c585690852e2c3e3700c2060ef0408a7e533d4e (diff) |
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>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp')
-rw-r--r-- | src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp | 3 |
1 files changed, 1 insertions, 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; } |