binary001
2nd April 2015, 17:19
Hi,
I change the pictures on my app background with Qtimer by using opacity (like Blend transaction).
It works well.
void MyDesktop:: paintEvent (QPaintEvent * ) {
QPainter BPainter1(this);
myBPix = QPixmap(fileName1);
BPainter1.setOpacity(1.0-_qBOpacity);
BPainter1.drawPixmap(1,1,this->width(),this->height(),myBPix);
QPainter Bpainter2(this);
myBPix2 = QPixmap(fileName2);
Bpainter2.setOpacity(_qBOpacity);
Bpainter2.drawPixmap(1,1,this->width(),this->height(),myBPix2);
}
Then I also move labels with Qtimer when I pressed a key.
Moving labels is ok but delay while background picture is changing.
So I want to run background picture changing on another Qthread.
To change picture opacity I use paintEvent on a widget.
How can I run a widget's paintEvent from another Qthread?
or Other Way?
Thanks.
I change the pictures on my app background with Qtimer by using opacity (like Blend transaction).
It works well.
void MyDesktop:: paintEvent (QPaintEvent * ) {
QPainter BPainter1(this);
myBPix = QPixmap(fileName1);
BPainter1.setOpacity(1.0-_qBOpacity);
BPainter1.drawPixmap(1,1,this->width(),this->height(),myBPix);
QPainter Bpainter2(this);
myBPix2 = QPixmap(fileName2);
Bpainter2.setOpacity(_qBOpacity);
Bpainter2.drawPixmap(1,1,this->width(),this->height(),myBPix2);
}
Then I also move labels with Qtimer when I pressed a key.
Moving labels is ok but delay while background picture is changing.
So I want to run background picture changing on another Qthread.
To change picture opacity I use paintEvent on a widget.
How can I run a widget's paintEvent from another Qthread?
or Other Way?
Thanks.