标题:如何在ui界面中嵌入令1个ui界面
作者:kench
日期:2017-03-16 14:28
内容:
新手,求详解
#1 [manbug 03-16 14:35]
设置父窗口吧
#2 [jinhuan 03-16 16:07]
用代码实现
#3 [清心永恒 03-17 09:07]
在 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
希望能够对你有用。
#4 [linsyn_218 03-17 09:18]
Qt 自定义界面类的提升,建议百度一下,适用于在Qt creator中设计界面类