由于我是QML的粉丝,所以我想制作一个QtCreator插件,以便我可以使用QML like 代码编写QWidgets ui。 QML可读性强,占用的状态少。 我的问题是如何将以下类似QML的 代码转换为以下.ui XML代码。
我提议的QML类似 代码:
QWidget {
name: "centralWidget"
QPushButton {
name: "pushButton"
geometry: {
x: 10
y: 20
width: 150
height: 50
}
text: "Hello World!"
}
}
.ui XML代码:
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>150</width>
<height>50</height>
</rect>
</property>
<property name="text">
<string>Hello World!</string>
</property>
</widget>
</widget>
</widget>
如果有人指出我正确的方向或分享示例代码/库,我将不胜感激!