Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Auto-indent selection
Forum Updated to NodeBB v4.3 + New Features

Auto-indent selection

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 5 Posters 1.1k Views 3 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    EDIT
    This post has been erroneously marked as solved.

    The suggested solution - building custom macro CANNOT be implemented in my current setup. I am in no position to try to find out why I cannot record macros in Qt Creator.

    While coding the file text gets pretty messy , so using "auto-indent selection" is not only usable to make things look pretty. It makes the code logic stand up.

    The "problem" is - to beautify the entire file requires two steps - "select all" and then "auto-indent selection" either via menu or "Ctrl" codes . It works as advertised, however...

    Is there a way to accomplish the task in ONE , single step ?

    Maybe even adding "select all" - Ctrl A as an option in file view woudl simplify things.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #3

      If using a combination of multiple shortcuts is something you do often you can record a macro from Tools -> Text Editing Macros, save it and then assign a single shortcut to it in Tools -> Options -> Environment -> Keyboard.

      A 1 Reply Last reply
      4
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        Is Ctrl+A followed by Ctrl+i what you are looking for ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #3

          If using a combination of multiple shortcuts is something you do often you can record a macro from Tools -> Text Editing Macros, save it and then assign a single shortcut to it in Tools -> Options -> Environment -> Keyboard.

          A 1 Reply Last reply
          4
          • Chris KawaC Chris Kawa

            If using a combination of multiple shortcuts is something you do often you can record a macro from Tools -> Text Editing Macros, save it and then assign a single shortcut to it in Tools -> Options -> Environment -> Keyboard.

            A Offline
            A Offline
            Anonymous_Banned275
            wrote on last edited by Anonymous_Banned275
            #4

            @Chris-Kawa
            Yes, I was looking for macro but was not sure if such term is used in Qt.
            Thanks

            Sorry, I got into Options -> Text Editor ( no Text Editing Macro option ) , there is as tab "Macro" , but there is no visible way to record the macro. I did try Alt+( as described in doc , but it did not work.
            I may have a OS / version issue. I could post the "form" but there is nothing about recoding macro in it, sorry.

            1 Reply Last reply
            0
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #5

              Hm, maybe you have the macros plugin disabled. Go to Help -> About Plugins and Look for Macros plugin in Utilities section. If it's off enable it and restart Qt Creator.

              A 1 Reply Last reply
              1
              • Chris KawaC Chris Kawa

                Hm, maybe you have the macros plugin disabled. Go to Help -> About Plugins and Look for Macros plugin in Utilities section. If it's off enable it and restart Qt Creator.

                A Offline
                A Offline
                Anonymous_Banned275
                wrote on last edited by Anonymous_Banned275
                #6

                @Chris-Kawa
                Many thanks

                This is what I got
                e63c2dab-1f4f-4aba-8cfe-7f07b178e3b0-image.png

                PS What is "beautifier" ? Can you give me reference to search for description?

                OK , found some description

                Here is th "options - test editor " form .
                No macro edit.

                b3565101-6fa7-4582-b9ff-a9138af3125e-image.png

                Chris KawaC jsulmJ 2 Replies Last reply
                0
                • A Anonymous_Banned275

                  @Chris-Kawa
                  Many thanks

                  This is what I got
                  e63c2dab-1f4f-4aba-8cfe-7f07b178e3b0-image.png

                  PS What is "beautifier" ? Can you give me reference to search for description?

                  OK , found some description

                  Here is th "options - test editor " form .
                  No macro edit.

                  b3565101-6fa7-4582-b9ff-a9138af3125e-image.png

                  Chris KawaC Offline
                  Chris KawaC Offline
                  Chris Kawa
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

                  PS What is "beautifier" ? Can you give me reference to search for description?

                  It's an umbrella term for tools that format source code, like clang-tidy for example. Qt Creator supports a couple of them: Beautifying Source Code.

                  1 Reply Last reply
                  1
                  • A Anonymous_Banned275

                    @Chris-Kawa
                    Many thanks

                    This is what I got
                    e63c2dab-1f4f-4aba-8cfe-7f07b178e3b0-image.png

                    PS What is "beautifier" ? Can you give me reference to search for description?

                    OK , found some description

                    Here is th "options - test editor " form .
                    No macro edit.

                    b3565101-6fa7-4582-b9ff-a9138af3125e-image.png

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

                    @AnneRanch said in Auto-indent selection:

                    No macro edit.

                    Go to "Tools/Text Editing Macros/Record Macro" (or press Alt+[) and record your macro.

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

                    ODБOïO 1 Reply Last reply
                    2
                    • jsulmJ jsulm

                      @AnneRanch said in Auto-indent selection:

                      No macro edit.

                      Go to "Tools/Text Editing Macros/Record Macro" (or press Alt+[) and record your macro.

                      ODБOïO Offline
                      ODБOïO Offline
                      ODБOï
                      wrote on last edited by ODБOï
                      #9

                      hi
                      just to add
                      @jsulm said in Auto-indent selection:

                      Go to "Tools/Text Editing Macros/Record Macro" (or press Alt+[) and record your macro.

                      then

                      "tools/options/environment // keyboard // record your shortcut"
                      https://doc.qt.io/qtcreator/creator-macros.html

                      edit :my bad.
                      This was already stated
                      by @Chris-Kawa

                      1 Reply Last reply
                      1

                      • Login

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