简体   繁体   中英

Qt Grid with QgraphicsItems drag and drop

so I'm currently making a scrabble game

and I have a QGraphicsScene with a grid on it. The grid is made out of tiles which are custom QGraphicsItems containing variables.

Now I also have another custom QGraphicsItem, which are the characters that should be placed on the tiles (so the other QGraphicsItems). How can I make the user put the characters on the tiles with some kind of drag and drop mechanism?

Thanks in advance

假设用户正在使用鼠标移动字符,则当他们在拖动字符后释放鼠标时,搜索最近的网格项目位置,然后使用可能的QGraphicsItemAnimation将图块动画化到该位置。

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