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 turns some of my spaces into tabs without any questions/setting breaking indentation. [SOLVED]
Forum Updated to NodeBB v4.3 + New Features

Qt Creator turns some of my spaces into tabs without any questions/setting breaking indentation. [SOLVED]

Scheduled Pinned Locked Moved Qt Creator and other tools
7 Posts 3 Posters 2.5k 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.
  • F Offline
    F Offline
    flashmozzg
    wrote on last edited by
    #1

    In my program I have something like this:
    @ui->plainTextEdit->textCursor().insertText(QString("blabla blablabla very long string");@
    I wanted to fit it in one screen so I made it look like this:
    @ui->plainTextEdit->textCursor().insertText(QString("blabla blablabla"
    . "very long string");@

    But no matter what setting I choose/disable (i want to keep tabulation with tabs though)
    even if I make it all spaces by hand it makes everything but the last few space - tabs.
    And it looks bad on github. I mean even if I make it all spaces, check that it all spaces - as soon as I save file it changes them back to tabs.

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      What version of Qt Creator are you using?

      I believe the relevant setting for your use-case is

      • Tools -> Options -> C++ -> Code Style -> Edit... -> General -> Align continuation lines -> With Spaces

      (Note: If you don't want to Edit a built-in style, click "Copy..." first to create a new style)

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • F Offline
        F Offline
        flashmozzg
        wrote on last edited by
        #3

        [quote author="JKSH" date="1411472092"]Hi,

        What version of Qt Creator are you using?

        I believe the relevant setting for your use-case is

        • Tools -> Options -> C++ -> Code Style -> Edit... -> General -> Align continuation lines -> With Spaces

        (Note: If you don't want to Edit a built-in style, click "Copy..." first to create a new style)[/quote]
        Qt Creator 3.2.1

        This setting changes only if the few latest chars will be spaces or tabs. I mean it still would do everything in tabs and if it's not enough - use spaces (like 5 five spaces tabs and then 3 spaces after that).

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          So if I understood correctly, you want all spaces, and no tabs?

          Set:

          • Tools -> Options -> C++ -> Code Style -> Edit… -> General -> Tab policy -> Spaces Only
          • Tools -> Options -> C++ -> Code Style -> Edit… -> General -> Align continuation lines -> With Spaces

          Also set:

          • Tools -> Options -> Text Editor -> Behavior -> Tab Policy -> Spaces Only
          • Tools -> Options -> Text Editor -> Behavior -> Align continuation lines -> With Spaces

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • F Offline
            F Offline
            flashmozzg
            wrote on last edited by
            #5

            [quote author="JKSH" date="1411481739"]So if I understood correctly, you want all spaces, and no tabs?

            Set:

            • Tools -> Options -> C++ -> Code Style -> Edit… -> General -> Tab policy -> Spaces Only
              *Tools -> Options -> C++ -> Code Style -> Edit… -> General -> Align continuation lines -> With Spaces

            Also set:

            • Tools -> Options -> Text Editor -> Behavior -> Tab Policy -> Spaces Only
            • Tools -> Options -> Text Editor -> Behavior -> Align continuation lines -> With Spaces[/quote]

            No. I want to keep tabs for code tabulation. I want to anything besides that (especially if it's needed for good looking code align) to use spaces (so that would be same with different tab settings).

            Here, I copied before and after to pastebin (check raw):
            http://pastebin.com/HbYVigSq

            I want to add that using auto-indentation (ctrl+i) and overall - it makes it as i want BUT for some reason after save it becomes wrong!

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on last edited by
              #6

              Have you tried to disable ?

              • Tools -> Options -> Text Editor -> Behavior -> Cleanups Upon Saving
              1 Reply Last reply
              0
              • F Offline
                F Offline
                flashmozzg
                wrote on last edited by
                #7

                [quote author="andreyc" date="1411484744"]Have you tried to disable ?

                • Tools -> Options -> Text Editor -> Behavior -> Cleanups Upon Saving[/quote]

                Thanks! That helped! Hope it doesn't disable/break some of other features I used too without me knowing.

                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