PDA

View Full Version : Editing and updating UI properties on the fly



llemes4011
4th August 2010, 15:44
Hi, I'm writing a program where the user can right click on a widget (such as a dial) and change the value of its initial settings (i.e., change initial value, tool tips, min max, etc), and then update the windows UI file, reflecting those changes.

Is there a high level call to accomplished this? Or does Qt have some other way of doing it?

thanks!

asvil
4th August 2010, 18:49
You may use qtpropertybrowser from qt-labs.
Download it, find in example 'objectcontroller'.
Create QWidgetAction, set 'objectcontroller' widget for it.
Create QMenu, add QWidgetAction to it;
Catch contextMenuEvent for your widgets, set selected widget to 'objectcontroller' and show QMenu.

llemes4011
4th August 2010, 19:19
I tried using the QFormBuilder::save() function, but the resulting .ui file was bad. The output was different than the original .ui file for the form.

I've looked at that property editor before, and i'm not a big fan of it...

asvil
4th August 2010, 19:26
I don't know fast way to save widget and its children properties into *.ui file.
You may enumerate property for all your widgets and save it into your file format (or QSettings).