PDA

View Full Version : Q_PROPERTY With Showing Property Like Geometry



Ashutosh2k1
11th May 2011, 07:26
Hi
I have made a custom Widget .Now i want to expose the different Properties of that Widget . I want to use a custm Property likeof Geometry so when it get expanded it shows the different Element and i can change the value in that attribute
For this i have created a class Custom Class and use the Q_PROPERTY to expose the different element which have to show the property.Now i am using that class in my original Widget and again exposing by Q_PROPERTY with that class but i ma not getting the result
Any Help would be great for me

ChrisW67
11th May 2011, 09:05
I have made a custom Widget .
OK

Now i want to expose the different Properties of that Widget . I want to use a custm Property likeof Geometry so when it get expanded it shows the different Element and i can change the value in that attribute
Sorry, lost me here. Properties are values stored against a QObject. They have no visual appearance. Where and how do you expect to "get expanded it shows different Element".?

For this i have created a class Custom Class and use the Q_PROPERTY to expose the different element which have to show the property.Now i am using that class in my original Widget and again exposing by Q_PROPERTY with that class but i ma not getting the result
No, hasn't made it any clearer.

Rephrase your post including more information, perhaps even code snippets, and explain what "not getting the result" means. You might even try asking a targeted question.

Ashutosh2k1
11th May 2011, 10:31
Ya
you are right. Suppose i want to show the Property Like Custom .It has Two element Like First and Second . So now i want to change the Value one and Two .
i can create a single Property valueas
Q_PROPERTY(int datatype ,READ dataType,WRITE setDAtaType)
So similarly i want to use something like this
Q_PROPERTY(CustomClass cls READ cls WRITE setCLs)
where
Custom class contains memeber like one and two so can it be possible