使用qt:如何在控制台应用程序上构建Gui OnTop? [英] using qt : How To Build a Gui OnTop Of a Console Application?

查看:131
本文介绍了使用qt:如何在控制台应用程序上构建Gui OnTop?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从野牛(解析器)生成的控制台应用程序,我想为其构建一个简单的GUI 这样我就可以将来自此gui的输入发送到控制台,并从控制台获取输出到gui. 我试图使用java进程类来做到这一点,但是它对我不起作用,请帮助我做到这一点 使用qt.

解决方案

这取决于您要向控制台应用程序中输入/输出数据的复杂性.

复杂度低 使用从Qt GUI传递到控制台应用程序的一些命令开关.查看 QProcess类文档.

高度复杂 我会选择类似RPC的解决方案.查看 QtDBus文档(仅适用于Linux/Unix).

注意:我假设您要使生成的野牛解析器与Qt GUI分开(以防您需要再次重新生成它).

i have a console application that generated from bison (a parser) and i want to build a simple gui for it so i can send input from this gui to the console and get output from the console into the gui . i tried to do that using java process class but it doesnt work for me , please help me to do that using qt .

解决方案

It depends on the complexity of the data you want to feed in/out of your console application.

Low complexity Use some command switches that you pass from your Qt GUI to your console application. Look at the QProcess class documentation.

High complexity I would go with an RPC-like solution. Look at the QtDBus documentation (Linux/Unix only).

Note: I made the assumption that you want to keep your generated bison parser apart from your Qt GUI (in case you need the regenerate it again).

这篇关于使用qt:如何在控制台应用程序上构建Gui OnTop?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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