PDA

View Full Version : QDesktopWidget Screenshot && Mouse grab



patrik08
29th March 2007, 01:20
I discovery a way to build mpg4 video from image.... on linux...
Now my question how i can grab Mouse to. ++

To build a video screen presentation from a programm... on action...



QDesktopWidget *desk = qApp->desktop();
QPixmap desktopscreen = QPixmap::grabWindow(desk->screen()->winId());

wysota
29th March 2007, 06:24
In general you can't. When I implemented my videograbber I just painter the cursor on the frame myself :)

patrik08
29th March 2007, 08:53
In general you can't. When I implemented my videograbber I just painter the cursor on the frame myself :)

Ok ... moveEvent(QMouseEvent *e) not work ... wenn i start a traceroute screenimage from a start QSystemTrayIcon *mTray; comand ..... or if widged is hide(); .... why?

all other listed event i can grab e->pos();



void mouseReleaseEvent(QMouseEvent *e);
void keyPressEvent(QKeyEvent *e);
void keyReleaseEvent(QKeyEvent *e);

wysota
29th March 2007, 10:51
I don't understand what you mean, but if you want to receive mouse move events even if the button is not pressed, you need to enable mouse tracking on the widget you wish to track.

In my grabber I just used QCursor::pos.