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)