约束与文本对齐不匹配

您将文本图层设置为按字符调整大小,将其对齐到一侧边缘,并约束到另一侧边缘。对齐方式决定了在文本变化时哪一侧边缘保持静止,但 QML 代码却遵循约束规则。随后,覆盖该文本的实例会移动该图层。

约束与文本对齐不匹配。

约束与文本对齐冲突的示例。

请将约束设置为文本对齐的边,或者将文本对齐到其受约束的边。

另请参阅 “修复转换问题”。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.