[SOLVED]how to create new widget by button clicked
-
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
-
what a foolish mistake!!!
thank you SGaist!!!