楼主。。。我下载了你给的程序,但是编译的时候报错了:
void ScreenSaver::slotForegroundChange()//move
{
int moveX=0,moveY=0;
qsrand((int)time(0));//这里有错误,说是time没有定义啊?怎么回事?
// moveX=(int)(screenWidthM*qrand()/(screenWidthM+1.0));
// moveY=(int)(screenHeightM*qrand()/(screenHeightM+1.0));
moveX=(int)(qrand()%screenWidthM);
moveY=(int)(qrand()%screenHeightM);
foreground->move(moveX,moveY);
qDebug()<<"slotForegroundChange"<<"X"<<moveX<<"Y"<<moveY;
}