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