scrollbar in QGroupBox
-
Hi raven-worx,
QHBoxLayout *ConfigurationLayout = new QHBoxLayout; QScrollArea* scrollArea = new QScrollArea(); scrollArea->setStyleSheet("QScrollArea {background-color:gray;}"); ConfigurationLayout->addWidget(ui->configurationBox);////ui->configurationbox is QGroupBox. mainBoxLayout->addLayout(ConfigurationLayout);
This is correctway or anything wrong I am doing.
-
@Apeksha
you dont add any widget to the scroll-area, i dont see any group-box widget and i don't see anysetWidgetResizable()
call.
Hard to say if you are doing all right, when you just post half of the code. -
QHBoxLayout *ConfigurationLayout = new QHBoxLayout;
QScrollArea *scrollArea = new QScrollArea;
scrollArea->setStyleSheet("QScrollArea {background-color:gray;}");
// ui->scrollArea->widgetResizable(true);
// scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
// scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scrollArea->setWidget(ui->configurationBox);
ConfigurationLayout->addWidget(ui->configurationBox);
scrollArea->setWidgetResizable(true);
// ConfigurationLayout->addWidget(ui->scrollArea);
mainBoxLayout->addLayout(ConfigurationLayout); -
@Apeksha
so still nosetMinimumSize()
call...
Beside that, are there any questions left from your side?! -
QWidget* contentWidget = ... contentWidget->setMinimumSize( 500,500 ); QScrollArea *scrollArea = new QScrollArea; scrollArea->setStyleSheet("QScrollArea {background-color:gray;}"); scrollArea->setWidget( contentWidget ); scrollArea->setWidgetResizable(true); QVBoxLayout* groupBoxLayout = new QVBoxLayout; groupBoxLayout->addWidget( scrollArea ); QGroupBox* groupBox = ... groupBox->setLayout( groupBoxLayout );
-
QHBoxLayout *ConfigurationLayout = new QHBoxLayout;
QScrollArea *scrollArea = new QScrollArea;
scrollArea->setStyleSheet("QScrollArea {background-color:rgb(215,214,213);}");
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
scrollArea->setWidget(ui->configurationBox);
//ConfigurationLayout->addWidget(ui->configurationBox);
scrollArea->setWidgetResizable(true);
scrollArea->setMinimumSize(811,50);
ConfigurationLayout->addWidget(scrollArea);
mainBoxLayout->addLayout(ConfigurationLayout); -
@Apeksha
yes...and?
Do you have a question?? Does it work for you or not?!