Skip to content

Qt解决:warning Z-order assignment

Published: at 01:12 PM | 1 min read

Qt中调整UI布局的时候,很容易出现如下警告:

warning : Z-order assignment: '' is not a valid widget.
warning : Z-order assignment: 'verticalSpacer' is not a valid widget.

虽然编译后运行看起来没什么问题,但是对于有轻微代码洁癖的人肯定是忍受不了的,解决办法也很简单,如下步骤:

        <zorder>label_7</zorder>
        <zorder>checkBox</zorder>
        <zorder>checkBox_2</zorder>
        <zorder>comboBox</zorder>
        <zorder></zorder>
        <zorder></zorder>
        <zorder>verticalSpacer</zorder>

重新编译一下警告应该就消失了。