Search code examples
c++performanceqtqframe

QGraphicsBlurEffect degrades the performance?


I am developing GUI in Qt5 with animation on QWidgets and QFrames, I have set blur effect on QFrame as I set QFrame as a parent of few of my QWidgets 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?


Solution

  • 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.