Solved How to hide a widget
-
How to hide a widget(like a button or Groupbox) in the ui and invoke it when user wants it.
-
QWidget::setVisible(bool)
http://doc.qt.io/qt-5/qwidget.html#visible-prop -
@VRonin thanks for the reply.I'm having another problem.
My ui has a QComboBox widget with 5 options and i have 5 different GroupBox for them.When the user selects an option corresponding GroupBox should appear in the ui at the fixed x,y location.So how do I hide 5 GroupBoxes in the same place and show only 1 GroupBox?? -
@Sherlin-N-G Why do you want to have 5 group boxes? Why not use one group box and fill in needed data depending on selection in combo box?
-
How can you dynamically create a group box based on users selection? Can you show me an example?
-
My groupbox gets huge for certain options and for some options it is small and simple.So suggest me how to create a groupbox for different user options in the QCombobox.
-
@Sherlin-N-G
Use Grid layout to fix widget locations -
@Sherlin-N-G said in How to hide a widget:
How can you dynamically create a group box based on users selection?
I don't understand what the problem is. You can see here how to create a QGroupBox (actually in the same way any other Qt widget is created): http://doc.qt.io/qt-5/qtwidgets-widgets-groupbox-example.html
-
@Sherlin-N-G please don't hijaack the topic of your post. If the issue with hiding a widget is solved, go and mark this post as such. Then, if you have a new issue with QGroupBox please go and create a new post about it. Thanks.