关于Qt 中paintEvent cpu占用率高的问题,救命啊!!!
void BaseView::paintEvent( QPaintEvent *pE )
{
if (bgMask==NULL)
{
if (NULL!=bg)
{
QPainter painter(this);
painter.drawPixmap(0,0,this->width(),this->height(),*bg);
}
int arcR = 2;
if (0==m_intRectCorner)
{
QPixmap bMask(this->width(),this->height());
QPainter p(&bMask);
p.fillRect(0,0,this->width(),this->height(), Qt::white);
if (bg)
{
p.drawPixmap(0,0,this->width(),this->height(),bg->mask());
}
this->setMask(bMask);
}
//画圆角
else if(1==m_intRectCorner)
{
QBitmap bmp(this->size());
bmp.fill();
QPainter p2(&bmp);
p2.setRende