tags:

views:

55

answers:

1

I'm making use of Q_PROPERTYs in my project, and I'm trying to figure out the best way to add some attributes to those properties (like min and max value).

It doesn't look like there's any where to store such attributes on the property itself... so I guess I have to store it on the object... statically, since the ranges will be the same for all instances of that class.

Looks like I may need a triplet, <propertyName, attributeName, value>.

What should I do? Use a QMap<QString, QVariant> and collapse the first two to "propertyName/attributeName"? If so, where would you initialize this map?

+1  A: 

Maybe have the property and other properties to describe the min/max values. It is straightforward and easy to understand and use- which to me is a plus.

Klathzazt
Have a property to describe another property? I could do it.... but it doesn't seem very elegant. Oh well..
Mark