I finally found the reason for this behavior in the function QLabelPrivate::documentRect in qlabel.cpp:
int m = indent;
if (m < 0 && q->frameWidth()) // no indent, but we do have a frame
m
= q
->fontMetrics
().
width(QLatin1Char('x')) / 2 - margin;
int m = indent;
if (m < 0 && q->frameWidth()) // no indent, but we do have a frame
m = q->fontMetrics().width(QLatin1Char('x')) / 2 - margin;
To copy to clipboard, switch view to plain text mode
When the label's frameShape is set to StyledPanel, frameWidth returns 1.
Bookmarks