scene=new QGraphicsScene;
this->setScene(scene);
this->setFixedSize(800,600);
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
QGraphicsLineItem *line=new QGraphicsLineItem(100,200,300,200);
line->setPen(QPen(Qt::red));
line->setPos(-100,100);//该行不是设置item在scene中的坐标吗?为什么设不设置都是在窗口中间显示呢?
scene->addItem(line);