Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

[QQuickPaintedItem] Problem with drawing text and lines

$
0
0
To get the lines to draw right you must use float coordinates and snap them to pixel center. Instead of painter->drawLine(100, 10, 100, 200); do painter->drawLine(100+0.5, 10+0.5, 100+0.5, 200+0.5); If it still looks blurry, it is because your item coords are not snapped to pixel bounds. This is, make sure you round your x and y pos (of the item itself) to an int. DISCLAIMER all this comes from a ton of exp with GraphicsView framework, but it should apply to qquick as well, because it is how (Antialiased) drawing works – you must pixel align.

Viewing all articles
Browse latest Browse all 4972

Trending Articles