Hi anda_skoa,
create new stack widget can be achieved.
but anther problem, several widgets into A. if i want the widget to be fullscreen that maybe have trouble.
by the way, i have two method,but have some problem. please give me any advice.
1. i use function as below, but info 'd_func() is private etc' when debugged.
{
if (d->layout->centralWidget() && d->layout->centralWidget() != widget) {
d->layout->centralWidget()->hide();
d->layout->centralWidget()->deleteLater();
}
d->layout->setCentralWidget(widget);
}
void QMainWindow::setCentralWidget(QWidget *widget)
{
Q_D(QMainWindow);
if (d->layout->centralWidget() && d->layout->centralWidget() != widget) {
d->layout->centralWidget()->hide();
d->layout->centralWidget()->deleteLater();
}
d->layout->setCentralWidget(widget);
}
To copy to clipboard, switch view to plain text mode
2. use layout , and then use show and hide function to set the widget into central widget, but segmentation fault also.
layout->addWidget(A);
layout->addWidget(B);
this->centralWidget()->setLayout(layout);
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget(A);
layout->addWidget(B);
this->centralWidget()->setLayout(layout);
To copy to clipboard, switch view to plain text mode
Added after 46 minutes:
Hi All,
i have handled the problem.
Thank your for your advice.
Best Regard.
ken
Bookmarks