summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/moc.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-05-18 23:11:31 +0300
committerAhmad Samir <a.samirh78@gmail.com>2023-06-22 02:20:29 +0300
commita993510c9eb2da86a24a0c42ce13fbe3a9fa062b (patch)
tree40c34721b0db1e77fd3969a9e6376808a4bab731 /src/tools/moc/moc.cpp
parent39882a1354cb06d2b0b0a0d5b41a168041df0476 (diff)
Moc: simplify showing a warning
Instead of changing the "index" member then restoring it, add a symbolAt() method to get the Symbol in question, and pass it to new warning() overload. Change-Id: Ie84a6cf4d837f4ed694f617100e9556c2fc2eea3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r--src/tools/moc/moc.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index e067158784..b6671f6e12 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -1931,13 +1931,10 @@ void Moc::checkProperties(ClassDef *cdef)
}
if (p.read.isEmpty() && p.member.isEmpty() && p.bind.isEmpty()) {
- const qsizetype rewind = index;
- if (p.location >= 0)
- index = p.location;
QByteArray msg = "Property declaration " + p.name + " has neither an associated QProperty<> member"
", nor a READ accessor function nor an associated MEMBER variable. The property will be invalid.";
- warning(msg.constData());
- index = rewind;
+ const auto &sym = p.location >= 0 ? symbolAt(p.location) : Symbol();
+ warning(sym, msg.constData());
if (p.write.isEmpty()) {
cdef->propertyList.removeAt(i);
--i;