gpt4 book ai didi

c++ - QtDesigner中如何默认隐藏QLabel

转载 作者:行者123 更新时间:2023-12-05 02:16:53 25 4
gpt4 key购买 nike

我一直在 Visual Studio 和 QtDesigner 中处理项目。
我想将 QLabel(pixel, mm) 设置为默认不可见。有人知道吗?

最佳答案

不可能设置QWidget visible-property在 QtDesigner 中,看到这个问题:Initially hidden control in Qt Creator .

您需要在初始化 UI 对象后在父构造函数中通过代码执行此操作:

ui->setupUi(this);
[...]
ui->myLabel->setVisible(false);

关于c++ - QtDesigner中如何默认隐藏QLabel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48928634/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com