From a87f13be56d8ded8e040a6d6f941ccc654187931 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 17 Dec 2014 18:43:00 -0800 Subject: [PATCH] Solve warning about unused function The function is unused, but gets used when developers are doing debugging. So instead of removing it completely, make it inline non-static. I've also moved it to a better place, so we don't forget about it. Change-Id: Id751869e6d6a7d46b4985ef9c09f45661e8cf839 Reviewed-by: Friedemann Kleint --- src/designer/src/lib/shared/layout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/designer/src/lib/shared/layout.cpp b/src/designer/src/lib/shared/layout.cpp index a72f01a..daf1c87 100644 --- a/src/designer/src/lib/shared/layout.cpp +++ b/src/designer/src/lib/shared/layout.cpp @@ -619,6 +619,8 @@ public: bool locateWidget(QWidget* w, int& row, int& col, int& rowspan, int& colspan) const; QDebug debug(QDebug str) const; + friend inline QDebug operator<<(QDebug str, const Grid &g) + { return g.debug(str); } private: void setCell(int row, int col, QWidget* w) { m_cells[ row * m_ncols + col] = w; } @@ -692,8 +694,6 @@ QDebug Grid::debug(QDebug str) const return str; } -static inline QDebug operator<<(QDebug str, const Grid &g) { return g.debug(str); } - void Grid::setCells(const QRect &c, QWidget* w) { const int bottom = c.top() + c.height(); -- 2.7.4