Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, January 2007
QPixmap - grabbing QGraphicsScene question


Message 1 in thread

Hello-

Im trying to grab only a small portion of the QGraphicsScene
using QPixmap::grabWidget().  I get the entire window so instead
I tried using the QGraphicsView::viewport() and I still
seem to get the entire window in the pixmap I get.

Is it possible to grab a QRectF into a pixmap?
If so, how do I do it?

Thanks,
Jeff

--
 [ signature omitted ] 

Message 2 in thread

Jeff Lacki wrote:
> Hello-
> 
> Im trying to grab only a small portion of the QGraphicsScene
> using QPixmap::grabWidget().  I get the entire window so instead
> I tried using the QGraphicsView::viewport() and I still
> seem to get the entire window in the pixmap I get.
> 
> Is it possible to grab a QRectF into a pixmap?
> If so, how do I do it?

You are looking for
void QGraphicsScene::render ( QPainter * painter, const QRectF & target
= QRectF(), const QRectF & source = QRectF(), Qt::AspectRatioMode
aspectRatioMode = Qt::KeepAspectRatio )

Stefan

--
 [ signature omitted ]