> On Jul 29, 2026, at 09:52, Kai Uwe Broulik <[email protected]> wrote:
> 
> Hi everyone,
> 
> Qt has a feature called AutoText where when you have a label (both in Qt 
> Widgets and Qt Quick) and its contents “look like HTML” (Qt::mightBeRichText) 
> it will switch to rich text (styled text) and start interpreting it as HTML.
> ...
> I therefore propose that for Qt 7 we switch to PlainText format by default. 
> We then need to figure out a way to make the transition easier (e.g. have an 
> environment variable that lets you force it right now to test your app, or 
> static code analysis that checks for HTML tags in strings, or…?). 
> Additionally, we may need to add additional textFormat properties where 
> useful.

Sure; this has come up a lot of times, going all the way back to 
https://qt-project.atlassian.net/browse/QTBUG-15578 at least.  But 
compatibility breaks are tricky and unpopular.

What if we go towards getting rid of AutoText altogether, since it’s a bit of 
an anti-pattern?  We could deprecate it now, and have a warning that the 
default will change to plain text in Qt 7, perhaps.  But that will tend to have 
the effect that people should add textFormat declarations to every instance 
now, to avoid sudden changes later.  Too bad that adds verbosity to the QML, 
unless we added an application-wide way to change the default, as you already 
proposed:  https://codereview.qt-project.org/c/qt/qtbase/+/498400  

-- 
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to