@@ -2256,11 +2256,33 @@ void AbstractMetaBuilder::parseQ_Property(AbstractMetaClass *meta_class, const Q
2256
2256
QStringList qualifiedScopeName = currentScope ()->qualifiedName ();
2257
2257
bool ok = false ;
2258
2258
AbstractMetaType *type = 0 ;
2259
- QString scope;
2259
+ int pIndex = 0 ;
2260
+ QString typeName = l.value (pIndex++);
2261
+ bool isConst = false ;
2262
+ if (typeName == " const" ) {
2263
+ // use the next part as the type name
2264
+ typeName = l.value (pIndex++);
2265
+ isConst = true ;
2266
+ }
2267
+ QString propertyName = l.value (pIndex++);
2268
+ QString modifiers;
2269
+ while (typeName.endsWith (" *" ) || typeName.endsWith (" &" )) {
2270
+ modifiers.insert (0 , typeName.at (typeName.length () - 1 ));
2271
+ typeName.chop (1 );
2272
+ }
2273
+ while (propertyName.startsWith (" *" ) || propertyName.startsWith (" &" )) {
2274
+ modifiers.append (propertyName.at (0 ));
2275
+ propertyName.remove (0 , 1 );
2276
+ if (propertyName.isEmpty () && pIndex < l.size ()) {
2277
+ propertyName = l.value (pIndex++);
2278
+ }
2279
+ }
2260
2280
for (int j=qualifiedScopeName.size (); j>=0 ; --j) {
2261
- scope = j > 0 ? QStringList (qualifiedScopeName.mid (0 , j)). join ( " :: " ) + " :: " : QString ( );
2281
+ QStringList scope (qualifiedScopeName.mid (0 , j));
2262
2282
TypeInfo info;
2263
- info.setQualifiedName ((scope + l.at (0 )).split (" ::" ));
2283
+ info.setIndirections (modifiers.count (' *' ));
2284
+ info.setReference (modifiers.contains (' &' )); // r-value reference seems improbable for a property...
2285
+ info.setQualifiedName (scope + QStringList (typeName));
2264
2286
2265
2287
type = translateType (info, &ok);
2266
2288
if (type != 0 && ok) {
@@ -2269,18 +2291,16 @@ void AbstractMetaBuilder::parseQ_Property(AbstractMetaClass *meta_class, const Q
2269
2291
}
2270
2292
2271
2293
if (type == 0 || !ok) {
2272
- ReportHandler::warning (QString (" Unable to decide type of property: '%1 ' in class '%2 '" )
2273
- .arg (l. at ( 0 ) ).arg (meta_class->name ()));
2294
+ ReportHandler::warning (QString (" Unable to decide type '%1' of property '%2 ' in class '%3 '" )
2295
+ .arg (typeName). arg (propertyName ).arg (meta_class->name ()));
2274
2296
continue ;
2275
2297
}
2276
2298
2277
- QString typeName = scope + l.at (0 );
2278
-
2279
2299
QPropertySpec *spec = new QPropertySpec (type->typeEntry ());
2280
- spec->setName (l. at ( 1 ) );
2300
+ spec->setName (propertyName );
2281
2301
spec->setIndex (i);
2282
2302
2283
- for (int pos=2 ; pos+1 <l.size (); pos+=2 ) {
2303
+ for (int pos=pIndex ; pos+1 <l.size (); pos+=2 ) {
2284
2304
if (l.at (pos) == QLatin1String (" READ" ))
2285
2305
spec->setRead (l.at (pos+1 ));
2286
2306
else if (l.at (pos) == QLatin1String (" WRITE" ))
0 commit comments