Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15, 6.6
-
None
Description
When using tab characters in QLabel, the tab spacing is inconsistent depending on the fact that it is using the internal QWidgetTextControl or not, which is the case of setting the textInteractionFlags property.
The default plain text mode just falls back to the style drawItemText(), and most styles normally use the QCommonStyle behavior, based on QPainter::drawText() that uses the horizontal advance of 8 "x" letters of the current font.
When the underlying text control is enabled, it uses the default (and absolute) 80 pixel tab stop distance instead.
I suppose that altering this "established" behavior may be an issue (especially for other widgets that explicitly use drawItemText() with tabs, such as QMenu), but this inconsistency is still quite important when dealing with fonts having an horizontal advance of x that is quite different than 10 pixels, and it should at least be documented.