PDA

View Full Version : grabbed QPixmap doesn't look right on XP



Cruz
3rd February 2009, 16:26
Hello,

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



QPixmap pm = QPixmap::grabWindow(QWidget::winId(), 0, 0, draggedWidget->width(), draggedWidget->height());

QDrag *drag = new QDrag(this);
drag->setPixmap(pm);


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?

Cruz
4th February 2009, 09:28
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.