Skip to content
  • 1 Votes
    3 Posts
    731 Views
    johngodJ

    I use

    qsTr(" sopdk apdapo dapodk aspod ad\n" + "ssdkopaksdopakdp ksopdak opdad\n" + "aiojdaios daoisd jaoidu aoidi adoia dj" )

    Let me know if someone uses other solutions

  • 1 Votes
    4 Posts
    2k Views
    S

    This is in regards to Qt5. As far as I can tell, this behavior is present on 5.12 and 5.15.

    As far as concrete examples and mimal examples, the snippet I provided above should suffice. Literally copy/paste that at the top of any QML file, and reformat and the extra lines will be added.

    Thank you for linking those bug reports. They are all related to Qt6 and report as fixed. Seems like qmlformat was just improved considerably in Qt6. Guess I'm just out of luck for Qt5. Perhaps I'll do as they say and try building a static Qt6 formatter from source and using that on Qt5...

  • 0 Votes
    3 Posts
    1k Views
    T

    Hi @JustASimpleCoder, I received a quick response from Qt staff, it seems that Qt6.2 version of qmlformat contains what we need! :)

    ./qmlformat -h Usage: ./qmlformat [options] filenames Formats QML files according to the QML Coding Conventions. Options: -h, --help Displays help on commandline options. --help-all Displays help including Qt specific options. -v, --version Displays version information. -V, --verbose Verbose mode. Outputs more detailed information. -i, --inplace Edit file in-place instead of outputting to stdout. -f, --force Continue even if an error has occurred. -t, --tabs Use tabs instead of spaces. -w, --indent-width <width> How many spaces are used when indenting. -n, --normalize Reorders the attributes of the objects according to the QML Coding Guidelines. -F, --files <file> Format all files listed in file, in-place -l, --newline <newline> Override the new line format to use (native macos unix windows). Arguments: filenames files to be processed by qmlformat