[Interest] qmllint/qmlformat problems

Matthew Fincham matthewf at cat.co.za
Sun Jun 22 13:10:42 CEST 2025


Hi Qt

I've been trying to adopt qmlformat, but have hit some problems I can't 
work around.

1. qmlformat moves comments for disabling qmllint to new lines, and in 
some cases it is impossible to get the disable on the correct line.  For 
example:

    EIUMAPQTE.ResourceMapHistoryControls { // qmllint disable required

becomes

    EIUMAPQTE.ResourceMapHistoryControls {
       // qmllint disable required

(because of MaxColumnWidth)

Ideally I would expect qmlformat to allow the maximum column width rule 
to be violated for linter disable comments. This is what clang-format 
does. Alternatively, and this would be nice, is to support a disable for 
the next line, similar to NOLINTNEXTLINE that clang-format supports.


2. qmlformat is removing some of the type annotations. For example:

    property var isSelected: function (dayOfMonth_, selectedDate_: Date) {
         return dayOfMonth_ == selectedDate_.getDate();
    }

becomes

    property var isSelected: function (dayOfMonth_, selectedDate_) {
         return dayOfMonth_ == selectedDate_.getDate();

    }

(the ': Date' annotation has been removed)

What is the best way to report this? Should it get a PR?

Many thanks
Matthew Fincham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20250622/2a05701a/attachment.htm>


More information about the Interest mailing list