You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, December 26th 2007, 5:02am

dump widgets on screen to xml

I am searching to find a way to output an xml representation of all of the widgets on the current screen. I have pondered two options so far:

1. Manually build a QDomEntity as I build the screens and then write this to an outfile using save.
This seems tedious and I was hoping to make this "dump" function less intrusive to the code.
2. Use something like KDE's UI Recovery Toolkit which takes code and recreates .ui (XML) files.
I would prefer not to use a third party solution and only want the XML for the current visible screen and not the entire application.

Does anyone have a better idea or solution to doing this?

Thanks!

Junior

Professional

  • "Junior" is male

Posts: 1,613

Location: San Antonio, TX USA

Occupation: Senior Secure Systems Engineer

  • Send private message

2

Thursday, December 27th 2007, 1:42am

RE: dump widgets on screen to xml

asparrel,

You could use the QApplication::allWidgets() to obtain a list, but you would have to parse that list for each widget and obtain the properties and whatever else interests you and push them to an xml format.

Hope this helps.

Junior

3

Tuesday, January 8th 2008, 8:15am

RE: dump widgets on screen to xml

I pursued this route but realized that I need to know about the widgets from QDialogs rather than QApplications. Not all of our QDialogs are associated with QApplications. Any ideas for a similar function to QApplication::allWidgets for QDialogs?

Thanks!