I'm trying to draw two single pixel lines onto a QImage with the following code:

Qt Code:
  1. QPainter linePainter(currentImage);
  2. linePainter.setRenderHint(QPainter::Antialiasing, false);
  3. linePainter.setPen(QPen(Qt::red,1));
  4. linePainter.drawLine(xSize/2, 0, xSize/2, ySize);
  5. linePainter.drawLine(0, ySize/2, xSize, ySize/2);
To copy to clipboard, switch view to plain text mode 

The image is displayed on a QLabel like this:

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

However, as you can see from the attached image, somewhere along the line something bad happens. The lines should be one pixel wide and bright red, however, the vertical line looks weird. How can I fix this?

CcdDialogCrosshairs.png