使用qt quick designer制作qml

哪位大神用qt quick designer制作过qml文件
我使用qt quick designer感觉不如代码编辑器灵活,好多功能都实现不了
有没有大神给指点指点

2个回答

Designer 是设计师,满足常规的一些操作,如果要进行更高级的処理,必然是要结合代码编辑器的。

一个是拖拽,一个是撸代码。。。没有哪个更好,只有哪个更合适!

chengnan5603
chengnan5603 谢谢,我已经放弃designer了,直接撸代码了
2 年多之前 回复

看了下面的说明,qt quick designer确实不能实现qml的所有逻辑,只能编辑 declarative form,而且还存在下面所列出的限制。
但在使用qt quick designer时总是在摸索着使用,一定有某些本来支持的功能没有发掘出来。
有没有qt quick designer更细的教程或是技巧总结,分享一下

The classical Widget Designer is built around the distinction between declarative form and imperative logic. The declarative form is designable and stored in .ui files.

In Qml it is easy to mix declarative code and imperative code. If you add imperative instructions (affecting visual aspects) to your Qml files they are not purely declarative anymore and the visual representation in the visual editor will break. The visual editor needs a way to translate the visual description back into the text description. For imperative code this is not possible in general and the Qt Quick Designer does not even try.

The documentation for QML Documents says:

Since Qt 5.4, a document can also have the file extension ".ui.qml". The QML engine handles these files like standard .qml files and ignores the .ui part of the extension. Qt Creator handles those files as UI forms for the Qt Quick Designer. The files can contain only a subset of the QML language that is defined by Qt Creator.

Qt Quick UI Forms:

You can use Qt Creator wizards to create UI forms that have the filename extension .ui.qml. The UI forms contain a purely declarative subset of the QML language. It is recommended that you edit the forms in the Design mode. However, exporting items as alias properties is a commercial only feature, and therefore you must use the Edit mode to do it if you are using the open source version of Qt Creator. Qt Creator enforces the use of the supported QML features by displaying error messages.

The following features are not supported:
•JavaScript blocks
•Function definitions
•Function calls (except qsTr)
•Other bindings than pure expressions
•Signal handlers
•States in other items than the root item
•Root items that are not derived from QQuickItem or Item

The following types are not supported:
•Behavior
•Binding
•Canvas
•Component
•Shader Effect
•Timer
•Transform
•Transition

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐