void MainWindow::on_pushButton_clicked()
{
w
= new QFrame(this);
//<<<<<<<<<<<<< change w to QFrame * w->move(0, 0);
w->setFixedSize(50, 200);
w->setVisible(true);
w
->setFrameStyle
(QFrame::Box);
//<<<<<<<<<<<<<< this is required}
void MainWindow::on_pushButton_2_clicked()
{
delete w;
}
void MainWindow::on_pushButton_clicked()
{
w = new QFrame(this); //<<<<<<<<<<<<< change w to QFrame *
w->move(0, 0);
w->setFixedSize(50, 200);
w->setVisible(true);
w->setFrameStyle(QFrame::Box); //<<<<<<<<<<<<<< this is required
}
void MainWindow::on_pushButton_2_clicked()
{
delete w;
}
To copy to clipboard, switch view to plain text mode
Bookmarks