Drawing widgets (such as buttons) over QGraphicsView

后端 未结 2 609
日久生厌
日久生厌 2021-01-06 23:43

How do I draw interactive widgets such as QButtons and Line Edits over a QGraphicsView? For ex, I have selected a region over an image in an image editing app which displays

2条回答
  •  误落风尘
    2021-01-06 23:57

    QGraphicsScene has a function addWidget() where you can add a widget to a scene. If you don't want to go through the scene addWidget function you can create a QGraphicsProxyWidget use setWidget() and add the proxy widget to your scene.

提交回复
热议问题