diff --git a/cfg/qt.cfg b/cfg/qt.cfg index 5ac7fb22f38..17895b64f31 100644 --- a/cfg/qt.cfg +++ b/cfg/qt.cfg @@ -5190,6 +5190,9 @@ QRectF QSizeF QPointF + QRect + QSize + QPoint QMutex diff --git a/test/cfg/qt.cpp b/test/cfg/qt.cpp index ab1019b4dcf..c09d037ee3a 100644 --- a/test/cfg/qt.cpp +++ b/test/cfg/qt.cpp @@ -23,6 +23,23 @@ #include #include #include +#include +#include +#include + +void unreadVariable_QPoint(const QPoint &s) +{ + // cppcheck-suppress unreadVariable + QPoint a; + // cppcheck-suppress unreadVariable + QPoint b{}; + // cppcheck-suppress unreadVariable + QPoint c{4, 2}; + // cppcheck-suppress unreadVariable + QPoint d(4, 2); + // cppcheck-suppress unreadVariable + QPoint e(s); +} void unreadVariable_QPointF(const QPointF &s) { @@ -52,6 +69,35 @@ void unreadVariable_QSizeF(const QSize &s) QSizeF e(s); } +void unreadVariable_QSize(const QSize &s) +{ + // cppcheck-suppress unreadVariable + QSize a; + // cppcheck-suppress unreadVariable + QSize b{}; + // cppcheck-suppress unreadVariable + QSize c{4, 2}; + // cppcheck-suppress unreadVariable + QSize d(4, 2); + // cppcheck-suppress unreadVariable + QSize e(s); +} + +void unreadVariable_QRect(const QPoint &topLeft, const QSize &size, const QPoint &bottomRight, const int x) { + // cppcheck-suppress unreadVariable + QRect a; + // cppcheck-suppress unreadVariable + QRect b{}; + // cppcheck-suppress unreadVariable + QRect c(0, 0, 100, 50); + // cppcheck-suppress unreadVariable + QRect d(x, x, x, x); + // cppcheck-suppress unreadVariable + QRect e(topLeft, size); + // cppcheck-suppress unreadVariable + QRect f(topLeft, bottomRight); +} + void unreadVariable_QRectF(const QPointF &topLeft, const QSizeF &size, const QPointF &bottomRight, const QRectF &rect, const qreal x) { // cppcheck-suppress unreadVariable QRectF a; @@ -647,7 +693,9 @@ namespace { } struct SEstimateSize { - inline const QString& get() const { return m; } + inline const QString& get() const { + return m; + } QString m; };