• 4800阅读
  • 3回复

主界面和外部应用程序如何相互切换 [复制链接]

上一主题 下一主题
离线haigf
 
只看楼主 倒序阅读 楼主  发表于: 2009-08-25
求教:

现设计了一个界面,上面分布一系列的按钮,点击各个按钮可以调用外部应用程序,然而不知如何在几个应用程序间切换??
例如:
主界面上有按钮A和B,分别调用外部应用程序(exe执行文件)C和D,点击A按钮弹出C程序界面,然后使用鼠标再点击主界面,没响应。请问如何实现主界面的响应,同时又不关闭C程序界面?
[ 此帖被haigf在2009-08-25 10:25重新编辑 ]
离线dbzhang800

只看该作者 1楼 发表于: 2009-08-27
这个问题出在你  “调用外部应用程序(exe执行文件)C和D” 的方式上
离线haigf
只看该作者 2楼 发表于: 2009-08-28
我使用QProcess产生一个进程对象,然后使用exec()调用外部应用程序,有办法解决吗?

QProcess w;
w.execute("d:\qt\findfile.exe");
离线dbzhang800

只看该作者 3楼 发表于: 2009-08-28
manual 中说的其实蛮清楚的,你选择 execute 就是要等它完成才能做其他的,你或者需要的是start

int QProcess::execute ( const QString & program, const QStringList & arguments )   [static]

Starts the program program with the arguments arguments in a new process, waits for it to finish, and then returns the exit code of the process. Any data the new process writes to the console is forwarded to the calling process.

void QProcess::start ( const QString & program, const QStringList & arguments, OpenMode mode = ReadWrite )

Starts the program program in a new process, if one is not already running, passing the command line arguments in arguments. The OpenMode is set to mode.

The QProcess object will immediately enter the Starting state. If the process starts successfully, QProcess will emit started(); otherwise, error() will be emitted. If the QProcess object is already running a process, a warning may be printed at the console, and the existing process will continue running.
快速回复
限100 字节
 
上一个 下一个