Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a hide property for pushbutton in Qt Creator?

Tags:

qt

qt-creator

Is there a hide property for pushbutton in Qt Creator property pallet? I am trying to find one but I am not able to find. I need to make some buttons disable & some hide. Should I use property pallet for it OR do it in constructor? Later on user event, they will be enable & shown.

like image 230
enterprize Avatar asked Jun 23 '11 21:06

enterprize


2 Answers

Some controls have "visibility" property on the palette, some don't. You always may do that programmatically (for example in the dialog's constructor):

MyButton->setVisible(false); //or true - later in the code
like image 63
mimic Avatar answered Sep 27 '22 21:09

mimic


In old versions of Qt Designer there was a property visible for it. But it seems that it was removed in new versions, so you can't use it directly.

But it is still possible to add this field in the .ui file. Just open any text editor, find the part related to the widget you need to hide, and insert this block in that place:

<property name="visible">
   <bool>false</bool>
</property>
like image 42
Ilya Avatar answered Sep 27 '22 21:09

Ilya