diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-03-23 13:53:04 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-03-23 13:26:03 +0000 |
commit | 3b4beaff963d087bb5c7b34c6c2713d5722fc122 (patch) | |
tree | 9a0c96ab28dcd4b7140073e372bd9d14b8b78332 /src | |
parent | 26be57463c9a29b40c205b2f19aaf9ae79b6ab6a (diff) | |
download | qttools-3b4beaff963d087bb5c7b34c6c2713d5722fc122.tar.gz |
Designer: Fix Grid::empty()
It returned whether it was _not_ empty. Found by GCC 7:
qt5/qttools/src/designer/src/lib/shared/layout.cpp:600:42: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
bool empty() const { return m_nrows * m_ncols; }
~~~~~~~~^~~~~~~~~
Inverted the result and fixed up the only caller.
Change-Id: I788eb2c45b382534275fbf0cca1bb27897a68a49
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/designer/src/lib/shared/layout.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/designer/src/lib/shared/layout.cpp b/src/designer/src/lib/shared/layout.cpp index 510d07a23..2bf68834a 100644 --- a/src/designer/src/lib/shared/layout.cpp +++ b/src/designer/src/lib/shared/layout.cpp @@ -606,7 +606,7 @@ public: void setCells(const QRect &c, QWidget* w); - bool empty() const { return m_nrows * m_ncols; } + bool empty() const { return !m_nrows || !m_ncols; } int numRows() const { return m_nrows; } int numCols() const { return m_ncols; } @@ -1120,7 +1120,7 @@ void GridLayout<GridLikeLayout, LayoutType, GridMode>::doLayout() GridLikeLayout *layout = static_cast<GridLikeLayout *>(createLayout(LayoutType)); - if (m_grid.empty()) + if (!m_grid.empty()) sort(); QDesignerWidgetItemInstaller wii; // Make sure we use QDesignerWidgetItem. |