views:

54

answers:

2

Hello,

i use the last Qt version for a projet and the QProcess : http://doc.qt.nokia.com/4.6/qprocess.html.

I have a question
- i want to lauch program from my application by using QProcess . I want to display a QGraphicsView transparent on full screen over the launched program.
For the moment: i hide the view, launch the program, sleep during 5 seconds and show the view. I want that my view keep the focus and stay on the top level? Is there any better way to do that? A custom setting for the QGraphicsView ?

Thanks you.

A: 

Once you run a program in QProcess, you have limited control over it. Qt does not provide details about other applications that are running, you won't know where the launched application is being displayed unless it tells you explicitly.

If you have access to the code of the application you're running, it is possible put a transparent overlay on top a given widget, or widgets, that could then record mouse clicks and other interactions. It's also possible to override events and record basic information about the application's use.

Kaleb Pederson
+2  A: 

Create your QGraphicsView (or the window that contains it) with the Qt::WindowStaysOnTopHint flag

Tom Sirgedas
We do this to mark areas of the screen to capture screenshots. It works beautifully.
andref
To make the QGraphicsView translucent, you will also need to set the Qt::WA_TranslucentBackground attribute on it.
Gareth Stockwell