void addPoint()
{
QRect r
(0,
0,canvas.
width(),canvas.
height());
p.begin(tpix);
for (int i=0; i<10;i++)
for(int j=0; j<10; j++)
{
p.fillRect(0,0,canvas.width(),canvas.height(),Qt::white);
p.setPen(Qt::red);
p.drawEllipse(a[i][j],a[i][j],3,3);
bitblt(&bck,pt,tpix,r,Qt::AndROP);
canvas.setBackGround(bck);
sleep(1);
}
p.end;
}
void addPoint()
{
QPixmap bck=canvas.backGround();
QPixmap *tpix=new QPixmap(canvas.width(),canvas.height());
QPainter p;
QRect r(0,0,canvas.width(),canvas.height());
QPoint pt(0,0);
p.begin(tpix);
for (int i=0; i<10;i++)
for(int j=0; j<10; j++)
{
p.fillRect(0,0,canvas.width(),canvas.height(),Qt::white);
p.setPen(Qt::red);
p.drawEllipse(a[i][j],a[i][j],3,3);
bitblt(&bck,pt,tpix,r,Qt::AndROP);
canvas.setBackGround(bck);
sleep(1);
}
p.end;
}
To copy to clipboard, switch view to plain text mode
Here addPoint is a slot connected to menu item.Matrix a is being filled through a fifo.
Bookmarks