Qt新技巧总结

最近在看一本关于qt游戏编程的书《Game Programming using Qt 5 Beginner's Guide》,里面对于qt的内容讲的非常细,对于之前没有用过的部分,做一下记录:

GraphicsView篇

QGraphicsScene设置在点击背景后不清除item焦点可以设置下面的属性

stickyFocus

QGraphicsView设置使用鼠标左键拖拽显示的内容

QGraphicsView::ScrollHandDrag

设置文本item不随parent发生尺寸缩放或旋转

text->setFlag(QGraphicsItem::ItemIgnoresTransformations);

猜你喜欢

转载自www.cnblogs.com/AlainGao/p/12230777.html
今日推荐