manuntn08
manuntn08

Reputation: 81

How to hide QLabel by default in QtDesigner

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 ?

Upvotes: 5

Views: 8690

Answers (2)

JustWe
JustWe

Reputation: 4484

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.

Upvotes: 0

ymoreau
ymoreau

Reputation: 4026

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);

Upvotes: 7

Related Questions