c++ - Smoothing an inclined line -
i can't find proper way draw smooth inclined line without having over-pixelated in qt qpainterpath object. note know doesn't make sense draw path in paintevent function, put there sake of simplicity. i'm trying draw line directly in central widget. hereafter snippet of code: void myobject::paintevent(qpaintevent *) { qpainterpath apath; apath.moveto(40.0, 60.0); //random values try apath.lineto(254, 354.0); qpainter painter(this); painter.setpen(qpen(qcolor(20, 20, 200), 10, qt::solidline)); painter.drawpath(apath); } and here result get: it's awful! beautiful lines can draw horizontal, vertical or 45° inclined ones... if looking drawing quality, qt documentation provides illustrative example ( 5.x version ) of use of render quality flags. generally, can use flags specified here ( 5.x version ), , set them using qpainter::setrenderhint() ( 5.x version ) function. see if able achieve desired quality using methods. c...