I’ve a class, derived of QObject and it has some members.
I load a configuration file with param value syntax. Each param is a member of the class and I want to set it’s value to value.
How is it possible, if it actually is? Thanks much!
PS I could have made an associative array but it’s not the way I prefer.
You have two ways of doing this:
Q_PROPERTYmacro. Then you can set it by name usingQObject::setProperty(..).Q_INVOKABLEmacro (or just make it aslot), then useQMetaObject::invokeMethod(..)to call it by name.