Hi,
are there variable variable names in Qt? I tried to search for it but I did not really know how to and so I found nothing. I have a php background and there I could do this. Can I do something similar in Qt?
My problem is that I have a class with several properties and a variable that tells me which property is interesting at the moment. In stead of writing a lot of if statements I would rather directly go the value by stating className.interestingValue.
Here is an example. I got the class car. Within that class have several properties like car.door = 4 and car.maxSpeed = 200 etc. On the other hand I got a variable testValue = "door". How can I get the number of doors now from my class car object without using if-statements? Like log.append("Your result is: "+audi.testValue.toStr());
Thanks
Bookmarks