PDA

View Full Version : How to open an external App inside QMainWindow



lorik
26th December 2011, 06:22
Hi ,

I want to open an external app (process) inside QMainWindow

How can I do it?

Lykurg
26th December 2011, 08:11
How about QProcess?

amleto
26th December 2011, 15:00
no, he wants it in a label (http://www.qtforum.org/article/37195/openning-new-process-window-inside-qmainwindow.html)

marcvanriet
28th December 2011, 02:04
no, he wants it in a label


From the docs : ... QProcess allows you to treat a process as a sequential I/O device. You can write to and read from the process ... You can then write to the process's standard input by calling write(), and read the standard output by calling read(), readLine(), and getChar(). Because it inherits QIODevice, ...

Depends if this is a console or gui app. I think Lykurg suggested this for a console app. Without more information from OP, it's hard to tell if this is an answer to his question.

Regards,
Marc

amleto
28th December 2011, 12:33
mainwindow is only available to gui app. Of course you can still read the standard/error output and send it to some text widget. But you can't open e.g. MS paint inside a widget.

marcvanriet
29th December 2011, 01:07
mainwindow is only available to gui app.

OK, let me be more clear : "The OP didn't specify if the external app he wants to start is a console app or not." If the external app is a console app, the QProcess approach will work.

And on Windows it IS possible to start an external app and make it appear inside another application. This requires some code in the external app though. But the OP is working on MacOS, and I don't know anything about that.