Skip to content

Commit b98b3f6

Browse files
authored
qt.cfg: Added support for QtRegion (#6148)
Reference: https://doc.qt.io/qt-6/qregion.html
1 parent 602d829 commit b98b3f6

File tree

3 files changed

+34
-13
lines changed

3 files changed

+34
-13
lines changed

cfg/qt.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5242,6 +5242,7 @@
52425242
<check>QRect</check>
52435243
<check>QSize</check>
52445244
<check>QPoint</check>
5245+
<check>QRegion</check>
52455246
</unusedvar>
52465247
<operatorEqVarError>
52475248
<suppress>QMutex</suppress>

test/cfg/qt.cpp

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <QLoggingCategory>
2525
#include <QTest>
2626
#include <QRectF>
27+
#include <QRegion>
2728
#include <QSizeF>
2829
#include <QPointF>
2930
#include <QRect>
@@ -32,6 +33,24 @@
3233

3334
#include <cstdio>
3435

36+
void unreadVariable_QRegion(const int x, const QRegion::RegionType type, const QPolygon &polygon, const QBitmap &bm, const QRegion &region, const Qt::FillRule fillRule)
37+
{
38+
// cppcheck-suppress unreadVariable
39+
QRegion a;
40+
// cppcheck-suppress unreadVariable
41+
QRegion b{};
42+
// cppcheck-suppress unreadVariable
43+
QRegion c{x,x,x,x};
44+
// cppcheck-suppress unreadVariable
45+
QRegion d{x,x,x,x, type};
46+
// cppcheck-suppress unreadVariable
47+
QRegion e{polygon, fillRule};
48+
// cppcheck-suppress unreadVariable
49+
QRegion f{bm};
50+
// cppcheck-suppress unreadVariable
51+
QRegion g{region};
52+
}
53+
3554
void unreadVariable_QPoint(const QPoint &s)
3655
{
3756
// cppcheck-suppress unreadVariable
@@ -721,14 +740,15 @@ bool knownConditionTrueFalse_QString_count(const QString& s) // #11036
721740

722741
void unusedVariable_qtContainers() // #10689
723742
{
724-
// cppcheck-suppress unusedVariable
725-
QMap<int, int> qm;
726-
// cppcheck-suppress unusedVariable
727-
QSet<int> qs;
728-
// cppcheck-suppress unusedVariable
729-
QMultiMap<int, int> qmm;
730-
// cppcheck-suppress unusedVariable
731-
QQueue<int> qq;
732-
// cppcheck-suppress unusedVariable
733-
QLatin1String ql1s;
734-
}
743+
// cppcheck-suppress unusedVariable
744+
QMap<int, int> qm;
745+
// cppcheck-suppress unusedVariable
746+
QSet<int> qs;
747+
// cppcheck-suppress unusedVariable
748+
QMultiMap<int, int> qmm;
749+
// cppcheck-suppress unusedVariable
750+
QQueue<int> qq;
751+
// cppcheck-suppress unusedVariable
752+
QLatin1String ql1s;
753+
}
754+

test/cfg/runtests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ function gnu_fn {
6565
# qt.cpp
6666
function qt_fn {
6767
if [ $HAS_PKG_CONFIG -eq 1 ]; then
68-
QTCONFIG=$(get_pkg_config_cflags Qt5Core Qt5Test)
68+
QTCONFIG=$(get_pkg_config_cflags Qt5Core Qt5Test Qt5Gui)
6969
if [ -n "$QTCONFIG" ]; then
70-
QTBUILDCONFIG=$(pkg-config --variable=qt_config Qt5Core Qt5Test)
70+
QTBUILDCONFIG=$(pkg-config --variable=qt_config Qt5Core Qt5Test Qt5Gui)
7171
[[ $QTBUILDCONFIG =~ (^|[[:space:]])reduce_relocations($|[[:space:]]) ]] && QTCONFIG="${QTCONFIG} -fPIC"
7272
# TODO: get rid of the error enabling/disabling?
7373
set +e

0 commit comments

Comments
 (0)