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 QRecetF, QsizeF and QPointF #6137

Merged
merged 1 commit into from
Mar 16, 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
2 changes: 2 additions & 0 deletions cfg/qt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5188,6 +5188,8 @@
<suppress>QApplication</suppress>
<suppress>QMutexLocker</suppress>
<check>QRectF</check>
<check>QSizeF</check>
<check>QPointF</check>
</unusedvar>
<operatorEqVarError>
<suppress>QMutex</suppress>
Expand Down
46 changes: 44 additions & 2 deletions test/cfg/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,52 @@
#include <QLoggingCategory>
#include <QTest>
#include <QRectF>
#include <QSizeF>
#include <QPointF>

void unreadVariable_QRectF() {
void unreadVariable_QPointF(const QPointF &s)
{
// cppcheck-suppress unreadVariable
QPointF a;
// cppcheck-suppress unreadVariable
QPointF b{};
// cppcheck-suppress unreadVariable
QPointF c{4.2, 4.2};
// cppcheck-suppress unreadVariable
QPointF d(4.2, 4.2);
// cppcheck-suppress unreadVariable
QPointF e(s);
}

void unreadVariable_QSizeF(const QSize &s)
{
// cppcheck-suppress unreadVariable
QSizeF a;
// cppcheck-suppress unreadVariable
QSizeF b{};
// cppcheck-suppress unreadVariable
QSizeF c{4.2, 4.2};
// cppcheck-suppress unreadVariable
QSizeF d(4.2, 4.2);
// cppcheck-suppress unreadVariable
QSizeF e(s);
}

void unreadVariable_QRectF(const QPointF &topLeft, const QSizeF &size, const QPointF &bottomRight, const QRectF &rect, const qreal x) {
// cppcheck-suppress unreadVariable
QRectF a;
// cppcheck-suppress unreadVariable
QRectF b{};
// cppcheck-suppress unreadVariable
QRectF c(0.0, 0.0, 100.0, 50.0);
// cppcheck-suppress unreadVariable
QRectF d(x, x, x, x);
// cppcheck-suppress unreadVariable
QRectF e(topLeft, size);
// cppcheck-suppress unreadVariable
QRectF f(topLeft, bottomRight);
// cppcheck-suppress unreadVariable
QRectF rect(0.0, 0.0, 100.0, 50.0);
QRectF g(rect);
}

void QString1(QString s)
Expand Down
Loading