Skip to content

Commit

Permalink
qt.cfg: Added support for QSize, QPoint and QRect
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitcowboy committed Mar 17, 2024
1 parent a062b99 commit cd17e12
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cfg/qt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5190,6 +5190,9 @@
<check>QRectF</check>
<check>QSizeF</check>
<check>QPointF</check>
<check>QRect</check>
<check>QSize</check>
<check>QPoint</check>
</unusedvar>
<operatorEqVarError>
<suppress>QMutex</suppress>
Expand Down
50 changes: 49 additions & 1 deletion test/cfg/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@
#include <QRectF>
#include <QSizeF>
#include <QPointF>
#include <QRect>
#include <QSize>
#include <QPoint>

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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -647,7 +693,9 @@ namespace {
}

struct SEstimateSize {
inline const QString& get() const { return m; }
inline const QString& get() const {
return m;
}
QString m;
};

Expand Down

0 comments on commit cd17e12

Please sign in to comment.