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. How to prevent tabs from being written as spaces?
Qt 6.11 is out! See what's new in the release blog

How to prevent tabs from being written as spaces?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
7 Posts 4 Posters 1.1k 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.
  • S Offline
    S Offline
    stretchthebits
    wrote on last edited by
    #1

    Hello,
    It seemed to work before.
    When I am working on a .h file or .cpp file, when I press on the tab key on the keyboard, it writes 4 white spaces.

    How can this be fixed? Why doesn’t it write a tab character?

    The Options dialog box seems to have been moved from the Tools menu to the Edit menu.

    OS: Kubuntu 22.04
    Qt Creator 10.0.0-beta2 (9.0.83)

    I think I had version 9.0 before.

    1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      This is a simple setting in QtCreator: Settings -> C++ -> Code Style -> Edit -> General

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      S 2 Replies Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        This is a simple setting in QtCreator: Settings -> C++ -> Code Style -> Edit -> General

        S Offline
        S Offline
        stretchthebits
        wrote on last edited by
        #3

        @Christian-Ehrlicher zzzzz.png

        is it suppose to be like this?
        It doesn't seem to have an effect.

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          This is a simple setting in QtCreator: Settings -> C++ -> Code Style -> Edit -> General

          S Offline
          S Offline
          stretchthebits
          wrote on last edited by
          #4

          @Christian-Ehrlicher I used the Qt Maintenance tool to remove the preview version, (10.0.0-beta2 ) and now I am back to 9.0.2.

          Thank the lord. It is working now. I have my tabs back.

          JonBJ jsulmJ 2 Replies Last reply
          0
          • S stretchthebits has marked this topic as solved on
          • S stretchthebits

            @Christian-Ehrlicher I used the Qt Maintenance tool to remove the preview version, (10.0.0-beta2 ) and now I am back to 9.0.2.

            Thank the lord. It is working now. I have my tabs back.

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

            @stretchthebits
            Up to you but you might like to report this to ensure the forthcoming release has it right.

            1 Reply Last reply
            0
            • S stretchthebits

              @Christian-Ehrlicher I used the Qt Maintenance tool to remove the preview version, (10.0.0-beta2 ) and now I am back to 9.0.2.

              Thank the lord. It is working now. I have my tabs back.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @stretchthebits Change "Tabs Only" in "Tab policy" ro "Spaces Only".

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              S 1 Reply Last reply
              0
              • jsulmJ jsulm

                @stretchthebits Change "Tabs Only" in "Tab policy" ro "Spaces Only".

                S Offline
                S Offline
                stretchthebits
                wrote on last edited by
                #7

                @jsulm I had it as Tabs only but that was for Qt Creator version 10....beta.
                So, I rolled back to the LTS version, 9.0.2 and it works fine.

                The GUI is ls also a bit confusing for me.
                There seems to be multiple locations where they have you configure this.
                If you change one place to tabs only, the other things stay as "spaces".

                I think I need a Qt Creator for dummies version.

                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