PDA

View Full Version : How do I place an item at the top left-hand corner of the QGraphicsView



ayanda83
21st December 2013, 12:40
Hi there, I need to know how to place an item at the top left-hand corner of the the QGraphicsView using the QGraphicsScene. And I would also like to know how to map the item’s width to the width of the QGraphicsView. If you are curious about what I am trying to achieve by this, I am building a custom chat application for my employer and I want to use the QGraphicsView to display online colleagues.

anda_skoa
21st December 2013, 13:41
Call QGraphicsView::mapToScene(0, 0) and move the item to the resulting position.
For size you can obviously also map the bottom-right corner of the view and extend the item accordingly.

You could also look into using QtQuick

Cheers,
_