根据触发的事件连接任意两个(多个)表单
我有一个带有pushbutton1的主窗口和一个带有pushbutton2的子窗口。当我单击主窗口上的pushbutton1时,我应该显示我的子窗口,同时隐藏主窗口。同样,当我单击子窗口上的pushbutton2时,我应该关闭子窗口并返回到我的主窗口。
另外,如何从另一个程序或文件获取某些事件并将其连接到此处? 我正在将 QtCreator2.0 与 ubuntu 10.10 一起使用。任何帮助或建议都将被极大地接受。
提前致谢。
I have a mainwindow with pushbutton1 and a subwindow with pushbutton2.When I click the pushbutton1 on my mainwindow I should show my subwindow while hiding the mainwindow.Similarly when I click the pushbutton2 on subwindow,I should close the subwindow and come back to my mainwindow.
Also how can I get some event from another program or file and connect it here?
Am using QtCreator2.0 with ubuntu 10.10.AnY help or advice are greatly accepted.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于一个进程中 qt 类之间的通信,您可以使用信号和槽。
对于进程间通信,您可以使用 DBus。
请参阅DBus 上的 Qt 文档。
附注你真的需要两个窗户吗?而不是 QStackedWidget?
For communication beetwen qt classes in one process you can use signals and slots.
For interprocess communication you can use DBus.
Look at Qt docs on DBus.
ps. Do you really need two window? and not QStackedWidget?