头文件声明
private:
int ID;
....
.cpp中
void boxes::CreatBoxes(QPointF point,int sp)
{
static const QColor colorTable[7] = {
QColor(200, 0, 0, 100), QColor(255, 200, 0, 100),
QColor(0, 0, 200, 100), QColor(0, 200, 0, 100),
QColor(0, 200, 255, 100), QColor(200, 0, 255, 100),
QColor(150, 100, 100, 100)
};
int shapeID = sp;
if (sp == RandomShape) {
shapeID = qrand() % 7;
}
ID=shapeID;//就是这句 把这句删掉的话 就可以运行 不删掉的就运行失败 不报错误 求解答
.....
}