Results 1 to 4 of 4

Thread: QDesktopWidget Screenshot && Mouse grab

  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QDesktopWidget Screenshot && Mouse grab

    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...

    Qt Code:
    1. QDesktopWidget *desk = qApp->desktop();
    2. QPixmap desktopscreen = QPixmap::grabWindow(desk->screen()->winId());
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDesktopWidget Screenshot && Mouse grab

    In general you can't. When I implemented my videograbber I just painter the cursor on the frame myself

  3. #3
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QDesktopWidget Screenshot && Mouse grab

    Quote Originally Posted by wysota View Post
    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();

    Qt Code:
    1. void mouseReleaseEvent(QMouseEvent *e);
    2. void keyPressEvent(QKeyEvent *e);
    3. void keyReleaseEvent(QKeyEvent *e);
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDesktopWidget Screenshot && Mouse grab

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.