简体   繁体   中英

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. If I remove blur effect set on QFrame animation works smoothly but when I set it it doesn't. So my question is, is QGraphicsEffects degrades the performance?

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 :

effect->setBlurHints(QGraphicsBlurEffect::PerformanceHint);

From the Qt documentation about QGraphicsBlurEffect::PerformanceHint :

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.

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