[英]QGraphicsBlurEffect degrades the performance?
I am developing GUI in Qt5 with animation on QWidget
s and QFrame
s, I have set blur effect on QFrame
as I set QFrame
as a parent of few of my QWidget
s and I set QPropertyAnimation
on QWidget
which increases and decreases its size depending upon action. 我正在Qt5中开发带有
QWidget
和QFrame
的动画的GUI,我在QFrame
上设置了模糊效果,因为我将QFrame
设置为我的几个QWidget
的父级,并且在QWidget
上设置了QPropertyAnimation
,它根据动作增加或减小其大小。 If I remove blur effect set on QFrame
animation works smoothly but when I set it it doesn't. 如果删除
QFrame
动画上设置的模糊效果,效果会很好,但设置时效果却QFrame
。 So my question is, is QGraphicsEffects
degrades the performance? 所以我的问题是,
QGraphicsEffects
会降低性能?
The blur effect has some overhead depending on the blur radius, the widget it is applied to and the blur hints. 模糊效果会产生一些开销,具体取决于模糊半径,应用于其的小部件以及模糊提示。 You can set the blur hint to
QGraphicsBlurEffect::PerformanceHint
: 您可以将模糊提示设置为
QGraphicsBlurEffect::PerformanceHint
:
effect->setBlurHints(QGraphicsBlurEffect::PerformanceHint);
From the Qt documentation about QGraphicsBlurEffect::PerformanceHint
: 从有关
QGraphicsBlurEffect::PerformanceHint
的Qt文档中:
Indicates that rendering performance is the most important factor, at the potential cost of lower quality.
表示渲染性能是最重要的因素,但可能会降低质量。
So if you set this hint, the performance would be much better. 因此,如果设置了此提示,性能将会更好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.