Some suggestions
-
【From China】
I really want that the ui could be changed with constructe function,or the constructe function will change as the ui manually changed.They should be the in time 同步的! -
Do you have an example of what you would like to see?
-
Yes ,the UI editor and the source code.
Sometimes I need UI editor to add a widget, and sometimes I need to use source code,
After these, I cant see all the widgets in UI editor, which bored me a little. -
-
In fact you have to use @setupUI@ in order to build the C++ side widgets from an XML file. I also believe that mixing the two approaches can be hard to maintain, so my suggestion is to stick with one, and in the case of ui designer, define where and initial properties of the widgets in the designer, and then change thier behavior dynamically according to the application evolution.
-
Note that
@setupUi()@
does not build the C++ side widgets from the XML file. It is just a generated function that actually constructs the GUI, but when ran, the XML (.ui) file is not used anymore. The xml is used to at compile time generate the setupUi() method, among other code. That code is then used to construct the actual GUI at runtime. -
[quote author="Andre" date="1346860206"]Note that
@setupUi()@
does not build the C++ side widgets from the XML file. It is just a generated function that actually constructs the GUI, but when ran, the XML (.ui) file is not used anymore. The xml is used to at compile time generate the setupUi() method, among other code. That code is then used to construct the actual GUI at runtime.[/quote]Thanks for the details, I knew that but mis-explained by myself. I meant that setupUI initializes widgets as from the manual C++ side (that is as the developer could do using pure C++). What I as not aware of was that the setupUI method was generated during the compile time from XML, I thought it was still accessing the XML.