[SOLVED]how to create new widget by button clicked
General and Desktop
3
Posts
2
Posters
713
Views
1
Watching
-
why this code doesn't work?
@connect(ui->pushButton_5 , SIGNAL(clicked()) , this , SLOT(createWidget()));
void MainWindow::createWidget()
{
QWidget *widget = new QWidget(ui->scrollArea);
widget->setStyleSheet("background : red");
widget->setGeometry(20 , 0 , 1190 , 40);
}@what is the right way to do this?
-
Hi,
You don't call show on your widget