Create a wrapper around your widget with QGraphicsProxyWidget