3

I've been working on project in Visual Studio and QtDesigner.
I want to set QLabel(pixel, mm) be invisible by default. Someone have any idea ?

ymoreau
  • 3,402
  • 1
  • 22
  • 60
manuntn08
  • 61
  • 1
  • 7

2 Answers2

5

It is not possible to set QWidget visible-property in QtDesigner, see this question : Initially hidden control in Qt Creator.

You need to do this through the code, in your parent constructor after initializing the UI objects:

ui->setupUi(this);
[...]
ui->myLabel->setVisible(false);
Murphy
  • 3,827
  • 4
  • 21
  • 35
ymoreau
  • 3,402
  • 1
  • 22
  • 60
0

You can't control the visible property, But if you want to make QLabel looks invisible as default, just set the width/height property to 0.

JustWe
  • 4,250
  • 3
  • 39
  • 90