Results 1 to 2 of 2

Thread: grabbed QPixmap doesn't look right on XP

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default grabbed QPixmap doesn't look right on XP

    Hello,

    When I drag and drop QWidgets around in my application, I take screenshots of them like this:

    Qt Code:
    1. QPixmap pm = QPixmap::grabWindow(QWidget::winId(), 0, 0, draggedWidget->width(), draggedWidget->height());
    2.  
    3. QDrag *drag = new QDrag(this);
    4. drag->setPixmap(pm);
    To copy to clipboard, switch view to plain text mode 

    I'm using grabWindow instead of grabWidget, because the widgets contain an OpenGL view and I get warnings when I try to grab them with grabWidget. grabWindow works just fine, although I don't understand why, since the screenshot should originate at coordinates 0,0 of the window and not the widget?

    Anyhow, the procedure works great on Linux and on Windows XP (so I thought), but now I found an XP SP2 machine where it doesn't. The grabbbed QPixmap is way too small, it only shows the top left corner of the widget. Debug outputs of sizes of the widget and the pixmap are all correct. Style sheets are definately not disturbing.

    Any thoughts?

  2. #2
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: grabbed QPixmap doesn't look right on XP

    Just adding some infos for the record.

    I can't reproduce the same error on any machine available to me. The machine where the screenshot doesn't look right is a Win XP 2002 SP 3, AMD 64 X2 3800+ and an Nvidia GeForce 6600. I also observed that just starting my application, which has one OpenGL view embedded, cranks the CPU up to 50% without anything happening at all. This is not the case on the same PC booted with Ubuntu.
    Last edited by Cruz; 4th February 2009 at 08:28. Reason: spelling error

Similar Threads

  1. QPixmap memory handling
    By Angelo Moriconi in forum Qt Programming
    Replies: 0
    Last Post: 1st December 2008, 15:37
  2. Drawing speed: QPixmap vs QPicture
    By maverick_pol in forum Qt Programming
    Replies: 1
    Last Post: 2nd January 2008, 19:17
  3. QPixmap bug under Qt4.3.1 ?
    By Nyphel in forum Qt Programming
    Replies: 8
    Last Post: 7th October 2007, 17:04
  4. QPixmap -> HICON trouble.
    By krivenok in forum Qt Programming
    Replies: 1
    Last Post: 11th August 2006, 15:51
  5. QPixmap and HBITMAP
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 16:24

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
  •  
Qt is a trademark of The Qt Company.