• 2802阅读
  • 4回复

[提问]如何在ui界面中嵌入令1个ui界面 [复制链接]

上一主题 下一主题
离线kench
 

只看楼主 倒序阅读 楼主  发表于: 2017-03-16
新手,求详解
离线manbug

只看该作者 1楼 发表于: 2017-03-16
设置父窗口吧
离线jinhuan

只看该作者 2楼 发表于: 2017-03-16
用代码实现
离线清心永恒

只看该作者 3楼 发表于: 2017-03-17
在 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
希望能够对你有用。
离线linsyn_218

只看该作者 4楼 发表于: 2017-03-17
Qt 自定义界面类的提升,建议百度一下,适用于在Qt creator中设计界面类
快速回复
限100 字节
 
上一个 下一个