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. Qt Creator: Don't add "*" to start of comment lines, (still) auto-indent inside comments

Qt Creator: Don't add "*" to start of comment lines, (still) auto-indent inside comments

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

    In Qt Creator, when I hit enter while typing inside a style /* .... */ comment, a "*" is normally inserted at the start of the next line. If I remove "*" from the 2nd line (before I continue typing; it won't appear automatically on the 3rd, but then the line isn't automatically indented.

    Is there a way I can change that? I basically want to have comments without "*" on the 2nd and subsequent lines, and with the option of auto-formatting content.

    Maybe this is related to clang-format (which is generally enabled), but I can't find a lot of information about comments formatting in its documentation...

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on last edited by mpergand
      #2

      Have a look at Preferences->Text Editor->Behaviour
      check for automatic indentation
      and options below.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        toralf
        wrote on last edited by toralf
        #3

        Maybe I'm blind or something, but I don't quite understand what options you are referring to. I see no mention of "*" on continuation lines. Also, the "automatic indentation" settings I can find, are the ones that appear to have no effect in the situation I was taking about. So what are you taking about exactly?

        JonBJ 1 Reply Last reply
        0
        • T toralf

          Maybe I'm blind or something, but I don't quite understand what options you are referring to. I see no mention of "*" on continuation lines. Also, the "automatic indentation" settings I can find, are the ones that appear to have no effect in the situation I was taking about. So what are you taking about exactly?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @toralf
          I see Options > Text Editor > Completion > Documentation Comments > Add Leading Asterisks option. Although it is under "Documentation Comments" this seems to work on your multiline comments in code. I think this is as close as it gets for what you want?

          T 1 Reply Last reply
          1
          • JonBJ JonB

            @toralf
            I see Options > Text Editor > Completion > Documentation Comments > Add Leading Asterisks option. Although it is under "Documentation Comments" this seems to work on your multiline comments in code. I think this is as close as it gets for what you want?

            T Offline
            T Offline
            toralf
            wrote on last edited by
            #5

            @JonB

            Yes, that works for the leading '*' at least. Never thought to look at that options page... Actually, I hardly even noticed it when I checked, although I must have reviewed its settings in the past.

            Thanks.

            Like I said, I guess the indentation bit might be a clang-format issue. It's still unclear to me (from reading the docs) how it's supposed to format comments.

            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