QGraphicsView和QGraphicsItem:缩放视图矩形时不缩放项目 [英] QGraphicsView and QGraphicsItem: don´t scale item when scaling the view rect
问题描述
我正在使用Qt的 QGraphicsView
-和 QGraphicsItem
-子类.当更改视图矩形时,例如,有没有一种方法可以在视图中不缩放项目的图形表示形式.放大时.默认行为是我的项目相对于我的视图矩形缩放.
I am using Qt´s QGraphicsView
- and QGraphicsItem
-subclasses.
is there a way to not scale the graphical representation of the item in the view when the view rectangle is changed, e.g. when zooming in. The default behavior is that my items scale in relation to my view rectangle.
我想可视化2D点,该点应由细矩形表示,该矩形在放大视图时不应缩放.请参见典型的3d建模软件以供参考,其中顶点总是以相同的大小显示.
I would like to visualize 2d points which should be represented by a thin rectangle which should not scale when zooming in the view. See a typical 3d modelling software for reference where vertex points are always shown at the same size.
谢谢!
推荐答案
将 QGraphicItem
的标志 QGraphicsItem :: ItemIgnoresTransformations
设置为true对您不起作用?
Set the QGraphicItem
's flag QGraphicsItem::ItemIgnoresTransformations
to true does not work for you?
这篇关于QGraphicsView和QGraphicsItem:缩放视图矩形时不缩放项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!