QGraphicsOpacityEffect make CPU tired

I want my widget Gradually appeared .

QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect(this);
myWidget->setGraphicsEffect(opacityEffect);
opacityEffect->setOpacity(0);

QTimer timerOpacity = new QTimer(this);
connect(timerOpacity,SIGNAL(timeout()),this,SLOT(changeOpacity()));
timerOpacity->start(100);

void Widget::changeOpacity()
{
    float opacity[10] =  {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1};
    this->opacityEffect->setOpacity(opacity[opalevel]);

    if (opalevel >= 9)
    {
        opalevel = 0;
        this->opacityEffect->setOpacity(1);
        this->timerOpacity->stop();
    }

    opalevel++;
}

I'm very satisfied with the effect of debugging on a computer.What I want to emphasize is the fact that when running on ARM11+Linux+Qt-embedded-4.6,the effect was bad.CPU load is too large,and the mouse response is slow . How to solve this problem ? Any help will be appreciated. Thanks in advance.

Answers


Due to hardware performance is limited, I reset color depth from 32bit to 16bit, the effect is very smooth.


Need Your Help

Spark read subgroup of binary files

python regex binary apache-spark pyspark

Is there a simple way to read only a given set of files contained in a directory with a Spark API (I use PySpark API) and the binaryFiles method?