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. Indentation issue on QT Creator

Indentation issue on QT Creator

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
12 Posts 3 Posters 467 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.
  • P Offline
    P Offline
    pundang
    wrote on 6 Apr 2025, 06:34 last edited by
    #1

    I have a .clang-format config which uses tab indentation with tab-size 4 and indent-size 4.

    The thing is that QT Creator's tab size is too big and it is kind of annoying to code like that.
    bda1fa14-bc9b-44ec-af98-a6f9202ef459-image.png
    d2d8e2b5-6e0a-4bfa-9d51-b2f45f470f05-image.png

    I tried switching text editor tab size, but that doesn't seem to fix anything.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 6 Apr 2025, 10:02 last edited by
      #2

      @pundang Please check the settings in Edit > Preferences > C++ > Code Style. The Text Editor settings are separate and not used for C++ files.

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      1
      • P Offline
        P Offline
        pundang
        wrote on 7 Apr 2025, 03:30 last edited by
        #3

        I have my clang-format config enabled (the project's clang-format config is the same as mine) and as you can see in the preview tab it looks fine
        image.png

        Also, you can see that the lines indicating tab spacing look fine, even thought the tabs look too big.
        qtcreator_bw1QWx8Mux.gif

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 7 Apr 2025, 05:33 last edited by
          #4

          @pundang Which Qt Creator version is that?

          Qt has to stay free or it will die.

          P 1 Reply Last reply 7 Apr 2025, 06:38
          0
          • A aha_1980
            7 Apr 2025, 05:33

            @pundang Which Qt Creator version is that?

            P Offline
            P Offline
            pundang
            wrote on 7 Apr 2025, 06:38 last edited by
            #5

            @aha_1980 my QT Creator version is 16.0.0 (16.0.0-202503111335)

            1 Reply Last reply
            0
            • A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 7 Apr 2025, 07:44 last edited by aha_1980 4 Jul 2025, 07:45
              #6

              @pundang That is interesting, because my dialog has some more settings in the upper part, that seem to be missing on yours:

              grafik.png

              Please double-check.

              Qt has to stay free or it will die.

              P 1 Reply Last reply 8 Apr 2025, 02:48
              0
              • A aha_1980
                7 Apr 2025, 07:44

                @pundang That is interesting, because my dialog has some more settings in the upper part, that seem to be missing on yours:

                grafik.png

                Please double-check.

                P Offline
                P Offline
                pundang
                wrote on 8 Apr 2025, 02:48 last edited by
                #7

                @aha_1980 Oh I'm sorry, my screenshot wasn't good enough.
                af7f9e1f-0c7f-4499-8ffd-b9f86581bc99-image.png

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote on 8 Apr 2025, 05:14 last edited by
                  #8

                  @pundang And is your file reformatted on save? Have you tried "Format while typing"?

                  Qt has to stay free or it will die.

                  P 1 Reply Last reply 8 Apr 2025, 05:49
                  0
                  • A aha_1980
                    8 Apr 2025, 05:14

                    @pundang And is your file reformatted on save? Have you tried "Format while typing"?

                    P Offline
                    P Offline
                    pundang
                    wrote on 8 Apr 2025, 05:49 last edited by
                    #9

                    @aha_1980 Yes, that option doesn't seem to fix anything.

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      pundang
                      wrote on 8 Apr 2025, 06:13 last edited by
                      #10

                      I found out that for some reason, when I load some files Qt Creator shows the correct indentation size.
                      qt_creator.gif

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        aha_1980
                        Lifetime Qt Champion
                        wrote on 8 Apr 2025, 08:08 last edited by
                        #11

                        @pundang Ok, can you please show your Text Editor settings? Edit > Preferences > Text Editor > Behavior > Tabs and Indentation

                        Is Auto detect checked there? How are the tab settings?

                        Qt has to stay free or it will die.

                        1 Reply Last reply
                        0
                        • J Offline
                          J Offline
                          JoeCFD
                          wrote on 9 Apr 2025, 17:31 last edited by
                          #12

                          can you show Kits->TextEditor tab?

                          1 Reply Last reply
                          0
                          • J JonB referenced this topic 23 days ago

                          6/12

                          7 Apr 2025, 07:44

                          • Login

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