if you dont want to make it a member than you can access the scene by calling

Qt Code:
  1. //draw dot
  2. void Unknown::drawDot()
  3. {
  4. //scene->addEllipse(50, 50, 1, 1, QColor(255, 0, 0), Qt::NoBrush);
  5. ui->graphicsView->scene()->addEllipse(50, 50, 1, 1, QColor(255, 0, 0), Qt::NoBrush);
  6. //We already set this in previous function so no need now
  7. //ui->graphicsView->setScene(scene);
  8. }
To copy to clipboard, switch view to plain text mode 

but as suggested you should learn to make a class.