Skip to content

Commit

Permalink
qt.cfg: Added support for QtRegion (#6148)
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitcowboy committed Mar 18, 2024
1 parent 602d829 commit b98b3f6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 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 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;
}

4 changes: 2 additions & 2 deletions test/cfg/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ function gnu_fn {
# qt.cpp
function qt_fn {
if [ $HAS_PKG_CONFIG -eq 1 ]; then
QTCONFIG=$(get_pkg_config_cflags Qt5Core Qt5Test)
QTCONFIG=$(get_pkg_config_cflags Qt5Core Qt5Test Qt5Gui)
if [ -n "$QTCONFIG" ]; then
QTBUILDCONFIG=$(pkg-config --variable=qt_config Qt5Core Qt5Test)
QTBUILDCONFIG=$(pkg-config --variable=qt_config Qt5Core Qt5Test Qt5Gui)
[[ $QTBUILDCONFIG =~ (^|[[:space:]])reduce_relocations($|[[:space:]]) ]] && QTCONFIG="${QTCONFIG} -fPIC"
# TODO: get rid of the error enabling/disabling?
set +e
Expand Down

0 comments on commit b98b3f6

Please sign in to comment.