Hi there,
I am new to QT Programming so I realize this problem seem rather stupid. I apologize in advance.

So basically I am trying to draw on an image using QPainter.
I have a QLabel on a QScrollArea:

Qt Code:
  1. imageLabel = new QLabel;
  2. scrollArea = new QScrollArea;
  3. scrollArea->setWidget(imageLabel);
To copy to clipboard, switch view to plain text mode 

after which I go ahead and load an image as a pixmap:

Qt Code:
  1. imageLabel->setPixmap(QPixmap::fromImage(image));
To copy to clipboard, switch view to plain text mode 

Now I have tried creating a function:

Qt Code:
  1. void Planning::paintNodes(QPaintEvent *){QPainter paintme(this);
  2. paintme.drawLine(QLineF(10.0, 80.0, 90.0, 20.0));
  3. }
To copy to clipboard, switch view to plain text mode 

In addition, i tried creating an action like so:
Qt Code:
  1. drawNodesAct = new QAction(tr("Draw &Nodes"),this);drawNodesAct->setShortcut(tr("Ctrl+N"));drawNodesAct->setEnabled(false);connect(drawNodesAct, SIGNAL(triggered()), this, SLOT(paintNodes(image.rect())));
To copy to clipboard, switch view to plain text mode 

and I try to call paintNodes from another function.
I am a little confused as to what I should define the parameter 'QPaintEvent *' to pass in as?
I read up a little and it said I should pass a QRect. How would I be able to get this code to work to merely draw a line on the loaded image?

I'm working on my senior design for electrical engineering and trying to create a GUI for our A* Planning algorithm.
Any help will be appreciated!