QProcess messaging and hidden?
-
I am not sure if this is possible but would love to get some ideas how to make this happen.
Basically I would like to start a process as a hidden window and be able to communicate send keyboard/mouse events to it and at the same time capture its window into pixels. Think capturing any app and then sending it to OpenGL for example to render it in a 3D environment or to capture a screenshot of this app.
Of course all this has to happen in steps so the first part is how can I simply send mouse/keyboard events to the process? Easily enough I have started the process using QProcess:start but from here I do not see anything obvious about how proceed next.
Thanks!
-=ben
-
Hi,
Qt won't do it. And to do it in platform specific code, could get complicated, if you want to face different platforms. On Windows you would have to emulate key/mouse events but those are always send to the currently active window. Or you have to simulate it completely.
What could be a solution is how squish does it (that's the test automation tool for Qt from frogligic). They can simulate mouse and keyboard for processes, but don't ask me how they do it.
-
"QWidget::winId()":http://doc.qt.nokia.com/latest/qwidget.html#winId
-
bq. Some people have been asking how to embed Qt painted content (and especially Qt widgets) in a 3d scene.
"http://labs.qt.nokia.com/2008/12/02/widgets-enter-the-third-dimension-wolfenqt/":http://labs.qt.nokia.com/2008/12/02/widgets-enter-the-third-dimension-wolfenqt/
Is that what you're looking for? Qt Widgets in 3d scene?
-
Jim: Thanks for the suggestion. I have seen this before and from the looks of it the widgets are still being drawn to the 2D screen as an overlay to the 3D engine, maybe I am wrong here? Ultimately however I need pixel access to the app in question.
Lukas: Thanks, I am aware of winId() however I need to get that from a QProcess which gives me the process handle as opposed to the window handle. As Gerolf suggests I will most likely need to branch platform specific code at this point which is ok; was hoping to avoid it if possible however.
Thanks.
-=ben