开发者

how to dynamically add a QWidget based to QGraphicsScene?

开发者 https://www.devze.com 2023-01-22 07:17 出处:网络
I want to add a QWidget based class(composed by buttons and labels an so on...) to my开发者_C百科 QGraphicScene scene in a special position and respecting the graphic style of my scene.?

I want to add a QWidget based class(composed by buttons and labels an so on...) to my开发者_C百科 QGraphicScene scene in a special position and respecting the graphic style of my scene.?

I am using QT 4.7.


You may use QGraphicsScene::addWidget() to add your widget to the scene and use the returned QGraphicsProxyWidget * to reposition your widget with QGraphicsItem::setPos(). Alternatively, you may look into QGraphicsWidget class.

0

精彩评论

暂无评论...
验证码 换一张
取 消