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. No luck beautifying code
Forum Updated to NodeBB v4.3 + New Features

No luck beautifying code

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 226 Views
  • 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.
  • rpieketR Offline
    rpieketR Offline
    rpieket
    wrote on last edited by
    #1

    I'm having some trouble reformatting my code with either the built-in code style, or the beautifier plugin.

    When I try to use the built-in code style (cmd+;), it formats my code in an undesirable style. I try to select different code styles in the Preferences, but this seems to have no effect. The code style sample shown under "Preferences/Code Style" is perfect. But when I go to "Auto-format Selection", it formats in a completely different style. No matter what I change in "Preferences/Code Style", it seems to make no difference. It always uses the same super-compact format, not the style I selected.

    And when I try to use the Beautifier plugin, "Format Current File" seems to have no effect at all. No matter whether I use Artistic Style, ClangFormat, or Uncrustify, it doesn't do anything. Nothing is being reformatted.

    What am I doing (or understanding) wrong?

    macOS Sonoma 14.2.1, Qt Creator 12.0.1

    cristian-adamC 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
    • rpieketR rpieket

      I'm having some trouble reformatting my code with either the built-in code style, or the beautifier plugin.

      When I try to use the built-in code style (cmd+;), it formats my code in an undesirable style. I try to select different code styles in the Preferences, but this seems to have no effect. The code style sample shown under "Preferences/Code Style" is perfect. But when I go to "Auto-format Selection", it formats in a completely different style. No matter what I change in "Preferences/Code Style", it seems to make no difference. It always uses the same super-compact format, not the style I selected.

      And when I try to use the Beautifier plugin, "Format Current File" seems to have no effect at all. No matter whether I use Artistic Style, ClangFormat, or Uncrustify, it doesn't do anything. Nothing is being reformatted.

      What am I doing (or understanding) wrong?

      macOS Sonoma 14.2.1, Qt Creator 12.0.1

      cristian-adamC Offline
      cristian-adamC Offline
      cristian-adam
      wrote on last edited by
      #2

      I've enabled the Beautifier plugin, set the path to clang-format that comes with Qt 12.0.1 on macOS Sonoma, in my case was:

      /Users/cristian/Qt/Qt Creator.app/Contents/Resources/libexec/clang/bin/clang-format
      

      Set the Use predifined style: File in order to pick up the .clang-format configuration file.

      It worked just fine.

      1 Reply Last reply
      3

      • Login

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