| 278 | } |
| 279 | |
| 280 | void MyGraphicsView::ReadFromFile(QTextStream &ts){ |
| 281 | ts.readLine(); |
| 282 | int v = ts.readLine().toInt(); |
| 283 | for(int i = 0; i < v; i++){ |
| 284 | double x, y, r; |
| 285 | ts >> x >> y >> r; |
| 286 | ts.readLine(); |
| 287 | MyGraphicsVexItem *vex = addVex(QPointF(x, y), r); |
| 288 | vex->setText(ts.readLine()); |
| 289 | } |
| 290 | int l = ts.readLine().toInt(); |
| 291 | for(int i = 0; i < l; i++){ |
| 292 | int s, e; |
| 293 | ts >> s >> e; |
| 294 | addLine(vexes[s], vexes[e]); |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | void MyGraphicsView::setHover(bool in){ |
| 299 | if(in) |