简体   繁体   中英

how to dynamically add a QWidget based to QGraphicsScene?

I want to add a QWidget based class(composed by buttons and labels an so on...) to my 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM