Skip to content

Commit

Permalink
qt.cfg: Added support for QtRegion
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitcowboy committed Mar 18, 2024
1 parent c3ceaa1 commit 13983a3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
1 change: 1 addition & 0 deletions cfg/qt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5242,6 +5242,7 @@
<check>QRect</check>
<check>QSize</check>
<check>QPoint</check>
<check>QRegion</check>
</unusedvar>
<operatorEqVarError>
<suppress>QMutex</suppress>
Expand Down
42 changes: 31 additions & 11 deletions test/cfg/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <QLoggingCategory>
#include <QTest>
#include <QRectF>
#include <QRegion>
#include <QSizeF>
#include <QPointF>
#include <QRect>
Expand All @@ -32,6 +33,24 @@

#include <cstdio>

void unreadVariable_QRegion(const int x, const QRegion::RegionType t type, const QPolygon &polygon, const QBitmap &bm, const QRegion &region, const Qt::FillRule fillRule)
{
// cppcheck-suppress unreadVariable
QRegion a;
// cppcheck-suppress unreadVariable
QRegion b{};
// cppcheck-suppress unreadVariable
QRegion c{x,x,x,x};
// cppcheck-suppress unreadVariable
QRegion d{x,x,x,x, type};
// cppcheck-suppress unreadVariable
QRegion e{polygon, fillRule};
// cppcheck-suppress unreadVariable
QRegion f{bm};
// cppcheck-suppress unreadVariable
QRegion g{region};
}

void unreadVariable_QPoint(const QPoint &s)
{
// cppcheck-suppress unreadVariable
Expand Down Expand Up @@ -721,14 +740,15 @@ bool knownConditionTrueFalse_QString_count(const QString& s) // #11036

void unusedVariable_qtContainers() // #10689
{
// cppcheck-suppress unusedVariable
QMap<int, int> qm;
// cppcheck-suppress unusedVariable
QSet<int> qs;
// cppcheck-suppress unusedVariable
QMultiMap<int, int> qmm;
// cppcheck-suppress unusedVariable
QQueue<int> qq;
// cppcheck-suppress unusedVariable
QLatin1String ql1s;
}
// cppcheck-suppress unusedVariable
QMap<int, int> qm;
// cppcheck-suppress unusedVariable
QSet<int> qs;
// cppcheck-suppress unusedVariable
QMultiMap<int, int> qmm;
// cppcheck-suppress unusedVariable
QQueue<int> qq;
// cppcheck-suppress unusedVariable
QLatin1String ql1s;
}

0 comments on commit 13983a3

Please sign in to comment.