How to Set QSCROLLBAR to GROUPBOX
-
im trying to set Qscrollbar to groupbox but its not working properly
my code is for setup is below-
uiPoMo->scrollArea->setWidget(uiPoMo->groupBox_SenoresDetails); uiPoMo->scrollArea->setWidgetResizable(true); uiPoMo->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); uiPoMo->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); QVBoxLayout* pQVBoxLayoutMain = new QVBoxLayout; pQVBoxLayoutMain->addWidget(uiPoMo->scrollArea); QWidget* central1 = new QWidget(this); central1->setLayout(pQVBoxLayoutMain);
-
Hi,
Do you mean you want to put a QScrollArea inside a QGroupBox ?
-
I did but no effect.
-
@Pranit-Patil It is quite unusual to put scroll bars into a QGroupBox (I can't remember ever seen an application with such an interface). Why do you want to do this?
-
@Pranit-Patil Then you should have a scroll area in the widget where this group box is, not inside the group box. So, the group box would get bigger when more elements will be inside and user will be able to scroll to access the whole group box.
-
sorry i didn't understand what your saying
-
@Pranit-Patil You put your group box in some widget, right? Then put there your scroll area and put the group box in this scroll area. I never saw a group box with scroll bars inside, this is really not how it should work. The scroll bars should be in the parent widget of your group box.