Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Change automatic qml reformatting column wrapping
Forum Updated to NodeBB v4.3 + New Features

Change automatic qml reformatting column wrapping

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 1 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    logic_cube
    wrote on last edited by
    #1

    In QtCreator it is possible to automatically format QML files using Tools > Qml/Js > Reformat file. The reformatting works well except that I would like to change the column value used to wrap code onto the next line from 80 to a higher value. Does anyone know how to do this?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      logic_cube
      wrote on last edited by
      #2

      I found a solution (sort of). Unfortunately the line length is hard coded in a file called qmljsreformatter.cpp which is built as a part of the qmljs.dll. So there are two ways you can change the line length that the QML / Javascript formatter uses:

      1. Get the Qt Creator source code and build a version yourself with the maxLineLength set to whatever you want.

      2. if you have Qt Creator 5.1 you could patch the qmljs.dll's bytes yourself using a hex editor to set the line length to a more sensible value of 125.
        @
        Replace 0x64 0x7e 0x17 0xff with 0x7d 0x7e 0x17 0xff
        Replace 0x10 0x83 0xe8 0x32 with 0x10 0x83 0xe8 0x4b
        Replace 0x50 0x7e 0x19 0x8b with 0x7d 0x7e 0x19 0x8b
        Replace 0x4d 0x89 0x44 0x24 with 0x7a 0x89 0x44 0x24
        @

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved