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 edit Makefiles in QtCreator
Forum Updated to NodeBB v4.3 + New Features

How to edit Makefiles in QtCreator

Scheduled Pinned Locked Moved Qt Creator and other tools
9 Posts 6 Posters 13.1k 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.
  • N Offline
    N Offline
    noli4qt
    wrote on last edited by
    #1

    My standard project settings replace tabs with spaces. However, when editing Makefiles qtcreator should not remove tabs as they have special meaning as a separator. Any idea how to make QtCreator leave tabs unchanged when editing Makefiles but use spaces otherwise? I'v checked with KDevelop3/4 they don't show this behavior.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      Are you using home-brew makefiles? Usually you shouldn't be tinkering with the autogenerated ones, as your changes will be overwritten anyway. As for the editor behavior, check the latest creator release (2.3 beta) maybe they fixed it there.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • N Offline
        N Offline
        noli4qt
        wrote on last edited by
        #3

        Yes, it's a custom Makefile project, no qmake involved. Checked with 2.2.1 which lets you - at least - copy tabs but when I save the file it converts tabs to spaces again, although it does that with newly edited lines only. ?!. There's vi to work around the issue.
        Nobody using qtcreator with custom Makefiles?

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

          You can uncheck "Insert spaces instead of tabs" in your Tools -> Options... -> Text Editor -> Behavior tab. That may help.

          Edit: Formatting.

          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
          • F Offline
            F Offline
            Franzk
            wrote on last edited by
            #5

            That doesn't suit the use case where you want tabs to be converted to spaces in your c code.

            "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

            http://www.catb.org/~esr/faqs/smart-questions.html

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

              [quote author="Franzk" date="1311179339"]That doesn't suit the use case where you want tabs to be converted to spaces in your c code.[/quote]

              Granted, but it is a temporary workaround that allows editing of tab-sensitive files. It's not perfect, but it beats having to dig out an external editor.

              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
              • Z Offline
                Z Offline
                Znahoj
                wrote on last edited by
                #7

                A very late answer to this question, since I saw this thread recently, but maybe someone still is interested.

                A workaround for this and to have "Insert spaces instead of tabs" option enabled is to edit the Makefiles in fakevim mode. When a "real tab" is needed inserting the combination <ctrl>-v,<tab> will give a "real tab" just as it does in the real vim.

                Kind regards,
                Znahoj

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  tobias.hunger
                  wrote on last edited by
                  #8

                  ... adding a generic highlighter for Makefiles does help a bit. Tools->Options->Text Editor->generic highlighter and download more definitons. By default we do not ship the Makefile definition file.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MichK
                    wrote on last edited by
                    #9

                    I know this is an old post but I want to describe a situation in this area which happened to me.
                    I spent few hours finding why my deb package build for Harmattan is incomplete (It didn't contain *harmattan.desktop, icon and app binary files).

                    At the end I found that rules file contained spaces instead of tabs in lines where make install was called and thus no file beside copyright and changelog files was copied.

                    Off course it was me who changed the file, but I didn't expect such a situation...

                    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