I'm trying to make a QLabel not visible by default in Qt Designer. I can hard code it but I was wondering if there was a way to set this using the designer.
m_uiForm.aLabel->setVisible(false);
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 .
For this use QLabel provides a useful mechanism for adding an mnemonic (see QKeySequence) that will set the keyboard focus to the other widget (called the QLabel's "buddy"). For example: QLineEdit *phoneEdit = new QLineEdit(this); QLabel *phoneLabel = new QLabel("&Phone:", this); phoneLabel->setBuddy(phoneEdit);
Zoom (Ctrl+wheel;+;-) in QtDesigner in QtCreator.
QLabel is used for displaying text or an image. No user interaction functionality is provided. The visual appearance of the label can be configured in various ways, and it can be used for specifying a focus mnemonic key for another widget.
As far as I know, this is not possible from QtDesigner.
The only way to access setVisible
directly from QtDesigner is when modifying connects you can find it as a slot.
The simplest way is just to set the visibility to false just like you are doing already.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With