PDA

View Full Version : Substitute of Qt::NotROP in QT4.5



shivam.priyadarshi
9th June 2009, 19:06
Hi Everybody,

I am porting an application from QT3.3 to QT4.5. The Qt3.3 code use setRasterOp function to set the mode Qt::NotROP. Following is snippet of code.



void setPainter(QPainter *p)
{
p->translate(-contentsX(), -contentsY());
p->scale(d->Scale, d->Scale);
p->translate(-d->ViewX1, -d->ViewY1);
p->setPen(Qt::DotLine);

p->setRasterOp(Qt::NotROP); // background should not be erased

p->drawLine(..........);
}


I wish to know what is substitution of Qt:NotROP in QT4. I have already tried [ p->setCompositionMode(QPainter::CompositionMode_Sourc eOut); ] which i found most close to NoTROP in Enum table. But this donot give same effect as Qt::NotROP. I am painting on viewport of Q3ScrollArea on mouse movement.

I will be thankful for your help.

wysota
9th June 2009, 19:34
There is no simple substitution. The concept of painting in Qt4 has changed and you shouldn't try to paint outside the paint event, if that's what you are doing.