@@ -2278,11 +2278,33 @@ void AbstractMetaBuilder::parseQ_Property(AbstractMetaClass *meta_class, const Q
2278
2278
QStringList qualifiedScopeName = currentScope ()->qualifiedName ();
2279
2279
bool ok = false ;
2280
2280
AbstractMetaType *type = 0 ;
2281
- QString scope;
2281
+ int pIndex = 0 ;
2282
+ QString typeName = l.value (pIndex++);
2283
+ bool isConst = false ;
2284
+ if (typeName == " const" ) {
2285
+ // use the next part as the type name
2286
+ typeName = l.value (pIndex++);
2287
+ isConst = true ;
2288
+ }
2289
+ QString propertyName = l.value (pIndex++);
2290
+ QString modifiers;
2291
+ while (typeName.endsWith (" *" ) || typeName.endsWith (" &" )) {
2292
+ modifiers.insert (0 , typeName.at (typeName.length () - 1 ));
2293
+ typeName.chop (1 );
2294
+ }
2295
+ while (propertyName.startsWith (" *" ) || propertyName.startsWith (" &" )) {
2296
+ modifiers.append (propertyName.at (0 ));
2297
+ propertyName.remove (0 , 1 );
2298
+ if (propertyName.isEmpty () && pIndex < l.size ()) {
2299
+ propertyName = l.value (pIndex++);
2300
+ }
2301
+ }
2282
2302
for (int j=qualifiedScopeName.size (); j>=0 ; --j) {
2283
- scope = j > 0 ? QStringList (qualifiedScopeName.mid (0 , j)). join ( " :: " ) + " :: " : QString ( );
2303
+ QStringList scope (qualifiedScopeName.mid (0 , j));
2284
2304
TypeInfo info;
2285
- info.setQualifiedName ((scope + l.at (0 )).split (" ::" ));
2305
+ info.setIndirections (modifiers.count (' *' ));
2306
+ info.setReference (modifiers.contains (' &' )); // r-value reference seems improbable for a property...
2307
+ info.setQualifiedName (scope + QStringList (typeName));
2286
2308
2287
2309
type = translateType (info, &ok);
2288
2310
if (type != 0 && ok) {
@@ -2291,18 +2313,16 @@ void AbstractMetaBuilder::parseQ_Property(AbstractMetaClass *meta_class, const Q
2291
2313
}
2292
2314
2293
2315
if (type == 0 || !ok) {
2294
- ReportHandler::warning (QString (" Unable to decide type of property: '%1 ' in class '%2 '" )
2295
- .arg (l. at ( 0 ) ).arg (meta_class->name ()));
2316
+ ReportHandler::warning (QString (" Unable to decide type '%1' of property '%2 ' in class '%3 '" )
2317
+ .arg (typeName). arg (propertyName ).arg (meta_class->name ()));
2296
2318
continue ;
2297
2319
}
2298
2320
2299
- QString typeName = scope + l.at (0 );
2300
-
2301
2321
QPropertySpec *spec = new QPropertySpec (type->typeEntry ());
2302
- spec->setName (l. at ( 1 ) );
2322
+ spec->setName (propertyName );
2303
2323
spec->setIndex (i);
2304
2324
2305
- for (int pos=2 ; pos+1 <l.size (); pos+=2 ) {
2325
+ for (int pos=pIndex ; pos+1 <l.size (); pos+=2 ) {
2306
2326
if (l.at (pos) == QLatin1String (" READ" ))
2307
2327
spec->setRead (l.at (pos+1 ));
2308
2328
else if (l.at (pos) == QLatin1String (" WRITE" ))
0 commit comments