PDA

View Full Version : Bounding QWidget within QGraphicsView



crazymonkey
22nd September 2010, 19:23
Hello I have a QGraphicsProxyWidget displayed on a QGraphicsView viewport (im rendering OpenGL within the viewport aswell)

ive been trying to make sure that the QGraphicsProxyWidget never goes out of bounds within my viewport (or mainwindow)

how do i make sure that if the user drags my proxywidget that it doesnt go out of bounds (ie make sure that you can always see the proxywidget no matter where the user drags it)

wysota
22nd September 2010, 19:44
Reimplement QGraphicsItem::itemChange() and handle the QGraphicsItem::ItemPositionChange case.