PDA

View Full Version : Can I display/print properties of QWidget?



dpatel
24th November 2010, 13:25
Hi,

I have a situation where for the first time I receive multitouch events on QDial and then I receive touch event on only on widget. For more info click here (http://www.qtcentre.org/threads/36164-Qt-Multi-touch-Dials-example-not-working-as-expected?highlight=)

What I want to do is get the state of QWidget (so something similar) when the application starts and then get the state of QWidget when I have touched it once and see what has changed which leads to change in behavior.

Is there any way to do that?

Thanks.

high_flyer
24th November 2010, 16:05
What I want to do is get the state of QWidget
Define 'state'.

dpatel
25th November 2010, 01:33
By state I meant everything about the widget, all the attributes and properties so that I can compare the (state of) widget before and after touch.

high_flyer
25th November 2010, 09:39
Each widget holds all kinds of attributes which you can get through the respective methods, such size() for size, geometry() for geometry and so forth.
Where is the problem?

dpatel
25th November 2010, 13:02
I am looking for one function that does the job. I guess I will have to get all the attributes individually.

Thanks.

MarekR22
25th November 2010, 13:57
Use meta data, check:
QObject::metaObject

QMetaObject::property

QMetaProperty


You can fetch list of all properties or just list of properties for given class (QMetaObject::propertyOffset).