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. Code formating question [solved!]
Forum Updated to NodeBB v4.3 + New Features

Code formating question [solved!]

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 5 Posters 2.3k 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.
  • P Offline
    P Offline
    pwnstar23
    wrote on last edited by
    #1

    Hi I am a newbie so this should be easy.

    I am trying to make my code formatted like
    @
    int MyFunc()
    {
    // code
    int x;
    x = 0;
    if (true)
    {
    //code
    }
    }
    @
    I can't figure out which options to change to get this behavior?

    EDIT: also how do you make it stop adding the closing brace for things like () "" and {}

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      Which options in what?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pwnstar23
        wrote on last edited by
        #3

        in the code editor i want that to be the default spacing, how do I set it up?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          CreMindES
          wrote on last edited by
          #4

          I think you should take a look at the "Qt Creator Code Style Settings":http://doc.qt.nokia.com/qtcreator-2.5/creator-code-style-settings.html ;)

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            I am going to guess that you mean Qt Creator and not Visual Studio, emacs, vim, Notepad++, Code::Blocks, Eclipse, or any of a multitude of other text editors you could be using to edit your code.

            Qt Creator 2.5:
            Tool menu, Text Editor group, Completion tab, "Automatically insert matching characters option"
            Tools menu, C++ group, Code Style tab.. click Copy and Edit your own indenting definition.

            1 Reply Last reply
            0
            • P Offline
              P Offline
              pwnstar23
              wrote on last edited by
              #6

              Thanks I got it working now!

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #7

                Moved to Tools forum. Try start your discussion in the right forum next time, and try to be clear about what tool you're talking about.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mlong
                  wrote on last edited by
                  #8

                  bq. Thanks I got it working now!

                  Good deal! Be sure and edit your original post and add [Solved] to the thread's title. Thanks!

                  Software Engineer
                  My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                  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