diff options
author | Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> | 2017-10-11 11:41:41 +0100 |
---|---|---|
committer | Sergio Martins <iamsergio@gmail.com> | 2017-10-11 11:41:41 +0100 |
commit | 175b6d12c9fe22de1ee854a1c8113ee03954a320 (patch) | |
tree | d9171cd0f0766b7fc3e4d023b2057a83d97d0171 /src | |
parent | 5e8c4a8647179b056b1cee0600f900987ebdc889 (diff) |
old-style-connect: Add a fixit for one more case
Fixes fixit when the argument types have different const reference,
for example "const QString &" vs "QString", which are compatible.
Diffstat (limited to 'src')
-rw-r--r-- | src/QtUtils.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/QtUtils.cpp b/src/QtUtils.cpp index 37e0f980..d050e671 100644 --- a/src/QtUtils.cpp +++ b/src/QtUtils.cpp @@ -150,6 +150,12 @@ bool QtUtils::isConvertibleTo(const Type *source, const Type *target) if (source->isFloatingType() && target->isFloatingType()) return true; + // "QString" can convert to "const QString &" and vice versa + if (source->isReferenceType() && source->getPointeeType().isConstQualified() && source->getPointeeType().getTypePtrOrNull() == target) + return true; + if (target->isReferenceType() && target->getPointeeType().isConstQualified() && target->getPointeeType().getTypePtrOrNull() == source) + return true; + return false; } |