QMetaProperty prop = object.metaObject()->property(index); // get the property object QString propName = prop.name(); // get the name of the property
QMetaProperty prop = object.metaObject()->property(name); // get the property object prop.write(&object, value); // set the property valueThis code sets the value of a property of an object using its name. Both examples use the Qt framework library.