From cb3152086c61e7c51ed1c5f8c5946364e19abc4d Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 21 Jan 2020 15:33:11 +0100 Subject: Introduce Q_PROPERTY attribute REQUIRED This is meant to correspond to required properties in QML. Change-Id: I2645981e13f7423bc86b48370c165b3cfe2aaa62 Task-number: QTBUG-81561 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/tools/moc/moc.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/tools/moc/moc.cpp') diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index d7a1af0a18..b562416c31 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -1238,6 +1238,9 @@ void Moc::createPropertyDef(PropertyDef &propDef) } else if(l[0] == 'F' && l == "FINAL") { propDef.final = true; continue; + } else if (l[0] == 'R' && l == "REQUIRED") { + propDef.required = true; + continue; } QByteArray v, v2; @@ -1960,6 +1963,7 @@ QJsonObject PropertyDef::toJson() const prop[QLatin1String("constant")] = constant; prop[QLatin1String("final")] = final; + prop[QLatin1String("required")] = required; if (revision > 0) prop[QLatin1String("revision")] = revision; -- cgit v1.2.3