找回密码
 立即注册
收起左侧

dialog怎么像mainWindow一样添加菜单

4
回复
7628
查看
[复制链接]
累计签到:87 天
连续签到:1 天
来源: 2013-6-30 22:27:42 显示全部楼层 |阅读模式
1Qter豆
如题 不是用代码添加 而是可以直接添加的那种。

或者求怎么把dialog改成mainwindow类型……因为写的差不多了改起来太麻烦了……

最佳答案

查看完整内容

我也没用过,看文档说 http://qt-project.org/doc/qt-5.0/qtwidgets/qlayout.html#setMenuBar
回复

使用道具 举报

累计签到:6 天
连续签到:1 天
2013-6-30 22:27:43 显示全部楼层
20030969 发表于 2013-7-1 22:11
在哪加……style 里面?

我也没用过,看文档说

Tells the geometry manager to place the menu bar widget at the top of parentWidget(), outside QWidget::contentsMargins(). All child widgets are placed below the bottom edge of the menu bar.


http://qt-project.org/doc/qt-5.0 ... out.html#setMenuBar
回复

使用道具 举报

累计签到:6 天
连续签到:1 天
2013-7-1 08:18:01 显示全部楼层
QLayout::setMenuBar()
试一下这个
回复

使用道具 举报

累计签到:87 天
连续签到:1 天
2013-7-1 22:11:32 显示全部楼层
KaoN 发表于 2013-7-1 08:18
QLayout::setMenuBar()
试一下这个

在哪加……style 里面?
回复

使用道具 举报

累计签到:1575 天
连续签到:2 天
2013-7-2 16:15:44 显示全部楼层
不如直接用mainwindow啊,估计不用改多少内容的。而且dialog类只是对话框,不适合做主窗口的。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

公告
可以关注我们的微信公众号yafeilinux_friends获取最新动态,或者加入QQ会员群进行交流:190741849、186601429(已满) 我知道了