QT菜单如何创建一个新窗口? [英] QT Menu how to create a new window?

查看:118
本文介绍了QT菜单如何创建一个新窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在QT Creator工作。

I am working in QT Creator.

我想提一提的是,我是这个软件的初学者。我成功创建了一个菜单,它具有:编辑和打开。我想创建一个新的窗口,当从菜单栏中的打开单击。到现在我成功在QMessageBox打印一个消息,当我按打开。用于将打开单击与新窗口链接的代码是什么?是否可以以某种方式在mainwindow.ui中拖放一个新窗口,然后将其与Open on action Open_activated()?相链接。

I would like to mention that I am beginner in this software. I succeeded to create a menu that has: Edit and Open. I would like to create a new window when " Open " from menu bar is clicked. Till now I succeeded to print a message in QMessageBox when I press Open. What is the code for linking Open clicked with a new window? Is it possible to somehow drag and drop a new window in mainwindow.ui and than link it with Open on action Open_activated()?

THX。赞赏

我在UBUNTU / C ++语言中工作

P.S I AM WORKING IN UBUNTU/C++ language

推荐答案

大部分问题已由上一个问题

好的,你回答说:菜单项打开是一个 QAction 。您可以将该操作连接到广告位您刚刚创建的。

Well, you answered that: the menu entry "Open" is a QAction. You can connect that action to the slot which you just created.

这篇关于QT菜单如何创建一个新窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆