Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MainWindow::painting(int mode) {
- if (mode == 1) {
- scene = new QGraphicsScene;
- //scene->setSceneRect();
- ui->graphicsView->setScene(scene);
- //scene->addLine(scene->width()/, 0, 100, 250, QPen(QBrush(Qt::black),1));
- int t_curr = 0, v_curr = -scene->height();
- int t2 = 0, v2 = -scene->height();
- while (t_curr < t_nagr/2 || v_curr < v_max) {
- int cnt = cnt_steps/2;
- int delta = 0;
- if (cnt % 2 == 1)
- v2 = v_curr + step_size;
- else
- t2 = t_curr + t_upd;
- scene->addLine(t_curr, v_curr - scene->height(), t2, v2 - scene->height(), QPen(QBrush(Qt::black),1));
- t_curr = t2;
- v_curr = v2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement