在 UI文件里添加一个Scroll Area 控件
然后在CPP 文件加入 ui->scrollArea_newDialog->setWidget(newDialg);
void QScrollArea::setWidget(QWidget *widget)
Sets the scroll area's widget.
The widget becomes a child of the scroll area, and will be destroyed when the scroll area is deleted or when a new widget is set.
The widget's autoFillBackground property will be set to true.
If the scroll area is visible when the widget is added, you must show() it explicitly.
Note that You must add the layout of widget before you call this function; if you add it later, the widget will not be visible - regardless of when you show() the scroll area. In this case, you can also not show() the widget later
希望能够对你有用。