[Interest] Beautifier for QML

Shantanu Tushar shaan7in at gmail.com
Wed Feb 8 14:45:59 CET 2017


Hi,

On Mon, Feb 6, 2017 at 11:53 AM, Shawn Rutledge <Shawn.Rutledge at qt.io> wrote:
>
> On Feb 5, 2017, at 10:18, Shantanu Tushar <shaan7in at gmail.com> wrote:
>
>> Hey folks,
>>
>> In our project we use astyle with the Qt Creator beautifier plugin,
>> its quite neat for C++. I was wondering if anything similar existed
>> for QML?
>
> Control-I re-indents the current line or the selection.  Control-A selects everything.
>
>> Quite a lot of devs in our team are shying away from Qt/QML
>> because of that reason.
>
> Wow, never heard that one before.  They are having so much trouble using the editor to write it normally in the first place?  Sounds like vanity anyway.  For Qt examples which thousands of people will read, maybe we should worry about it, but in regular production code?

Well we're a small company (see www.sostronk.com) where till very
recently I was the only guy writing Qt/C++. The rest of the folks were
either working on the server (Go) or the webapp (Angular and stuff).
They're quite used to Sublime/VSCode having very powerful auto
formatting tooling so they come to expect the same from QtCreator. And
tbh it does help if an automated tool is fixing small styling issues
so that during code reviews you can spend more time on the actual
business logic than "oh wait you're missing a semicolon here" :P

>
> You can probably repurpose some other tool for which the supported syntax is close enough - maybe a JS reformatter tool of some sort?  Or even a C++ tool if its parser isn’t too picky?

Yep that can work. Essentially moving all JS logic to separate *.js
files which can then be formatted by existing tools. Thanks for the
tip :)

>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

Cheers,

-- 
Shantanu Tushar    (UTC +0530)
shantanu.io



More information about the Interest mailing list