我在 Qt5 中使用 QWidget
和 QFrame
上的动画开发 GUI,我在 QFrame
上设置了模糊效果,因为我设置了 QFrame
作为我的几个 QWidget
的父级,我在 QWidget
上设置了 QPropertyAnimation
,这取决于它的大小行动后。如果我删除在 QFrame
上设置的模糊效果,动画会顺利运行,但当我设置它时,它不会。所以我的问题是,QGraphicsEffects
会降低性能吗?
最佳答案
模糊效果有一些开销,具体取决于模糊半径、应用它的小部件和模糊提示。您可以将模糊提示设置为 QGraphicsBlurEffect::PerformanceHint
:
effect->setBlurHints(QGraphicsBlurEffect::PerformanceHint);
来自关于 QGraphicsBlurEffect::PerformanceHint
的 Qt 文档:
Indicates that rendering performance is the most important factor, at the potential cost of lower quality.
所以如果你设置这个提示,性能会好很多。
关于c++ - QGraphicsBlurEffect 会降低性能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28579659/