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. Creator: How to configure "Complete switch statement"?
Forum Updated to NodeBB v4.3 + New Features

Creator: How to configure "Complete switch statement"?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
7 Posts 3 Posters 999 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.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    Hi all,

    I find fixes such as "complete switch statement" extremely useful. However, in the end I spend as much time formatting the result according to my coding standards as I would have writing the case statements myself.
    How and where can I configure such "quick fixes"?

    jsulmJ 1 Reply Last reply
    0
    • A Asperamanca

      Hi all,

      I find fixes such as "complete switch statement" extremely useful. However, in the end I spend as much time formatting the result according to my coding standards as I would have writing the case statements myself.
      How and where can I configure such "quick fixes"?

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

      @Asperamanca To my knowledge QtCreator uses templates for such things, but I don't remember where those are located. Search for them and edit the one you want to change.

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

      A 1 Reply Last reply
      1
      • jsulmJ jsulm

        @Asperamanca To my knowledge QtCreator uses templates for such things, but I don't remember where those are located. Search for them and edit the one you want to change.

        A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        @jsulm
        I think what you refer to are snippets, which can be edited under Text Editor -> Snippets
        I haven't found any plain text file containing a relevant phrase from the quick fix, which suggests that these are hard-coded somewhere.

        JonBJ 1 Reply Last reply
        0
        • A Asperamanca

          @jsulm
          I think what you refer to are snippets, which can be edited under Text Editor -> Snippets
          I haven't found any plain text file containing a relevant phrase from the quick fix, which suggests that these are hard-coded somewhere.

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

          @Asperamanca
          I cannot remember exactly where it is. But you can alter the style/layout of things like a switch() statement, though only to a limited extent. It is somewhere in your "C++ style settings" in Creator. It shows you how switch/if etc. constructs will be created.

          jsulmJ A 2 Replies Last reply
          2
          • JonBJ JonB

            @Asperamanca
            I cannot remember exactly where it is. But you can alter the style/layout of things like a switch() statement, though only to a limited extent. It is somewhere in your "C++ style settings" in Creator. It shows you how switch/if etc. constructs will be created.

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

            @JonB @Asperamanca Yes, it is in "C++/Code Style". Make a copy of the current style and go to "Edit...".

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

            1 Reply Last reply
            1
            • JonBJ JonB

              @Asperamanca
              I cannot remember exactly where it is. But you can alter the style/layout of things like a switch() statement, though only to a limited extent. It is somewhere in your "C++ style settings" in Creator. It shows you how switch/if etc. constructs will be created.

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

              @JonB
              Ah yes. True, The options there don't cover my case (each case scoped by curly brackets), so the quick fix follows what is configured.

              JonBJ 1 Reply Last reply
              0
              • A Asperamanca

                @JonB
                Ah yes. True, The options there don't cover my case (each case scoped by curly brackets), so the quick fix follows what is configured.

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

                @Asperamanca said in Creator: How to configure "Complete switch statement"?:

                each case scoped by curly brackets

                Yeah, it only has some limited layout alterations.
                I do this now, but only if I find I need to declare any variables in the particular case clause.

                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