Why does QPainter::drawPoint draw a horizontal line segment?
问题 I'm trying to draw a 3-pixel large point with QPainter . But the following code instead draws a horizontal line with width of 3 pixels. #include <QPainter> #include <QImage> int main() { const int w=1000, h=1000; QImage img(w, h, QImage::Format_RGBX8888); { QPainter p(&img); p.fillRect(0,0,w,h,Qt::black); p.scale(w,h); p.setPen(QPen(Qt::red, 3./w, Qt::SolidLine, Qt::RoundCap)); p.drawPoint(QPointF(0.1,0.1)); } img.save("test.png"); } Here's the top left corner of the resulting image: I am