Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt.cfg: Added support for QSize, QPoint and QRect #6138

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading