When generating cpp code from .ui files, uic has to map elements/properties of the widgets to methods on the object.
For example if I have a widget declaration
<widget class="QPushButton" name="button">
<property name="geometry">
<rect>
<x>910</x>
<y>140</y>
<width>101</width>
<height>117</height>
</rect>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="button">
<property name="geometry">
<rect>
<x>910</x>
<y>140</y>
<width>101</width>
<height>117</height>
</rect>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
To copy to clipboard, switch view to plain text mode
I get some cpp code like:
button
->setObjectName
(QString::fromUtf8("button"));
button
->setGeometry
(QRect(910,
140,
101,
117));
button->setFlat(true);
button = new QPushButton(MainUI);
button->setObjectName(QString::fromUtf8("button"));
button->setGeometry(QRect(910, 140, 101, 117));
button->setFlat(true);
To copy to clipboard, switch view to plain text mode
I'm wondering how uic knows which elements/properties of the .ui file are mapped to the methods on the objects? I had a quick look at the uic source and the logic seemed to be hard coded in the source rather than a declarative config of rules that could be changed when uic undergoes an upgrade or the Qt API changes.
Does anybody know of a list that specifies how uic maps .UI XML to cpp code?
Regards
Bookmarks