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 - no highlighting for ifdef blocks
Forum Updated to NodeBB v4.3 + New Features

Qt Creator - no highlighting for ifdef blocks

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 2 Posters 5.0k 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.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on last edited by
    #1

    I'm currently working on an application, that due to it's nature requires quite a lot of ifdefs in the code. I'm developing on Kubuntu, with Qt Creator using Kate's syntax highlighting.

    The problem is that inside ifdef blocks the code is grayed-out. I understand that this might be a good feature for some people that want to omit parts of the code that are not currently defined, but I would like to have highlighting everywhere. Is it possible to change this behaviour? I have looked through QtC's options, but found none. As a temporal hack, I simply comment the ifdefs out during my coding, but it's not very elegant or useful.

    (Z(:^

    1 Reply Last reply
    0
    • K Offline
      K Offline
      ken536
      wrote on last edited by
      #2

      I don't know how to make QT do it like you want to, but you can do this:

      • Only use #ifdef (not #else)
      • Create a new build configuration where you define al those.
      • Switch when you build to your normal configuration.
      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        Doesn't seem to be working. But it looks like a nice idea :)

        (Z(:^

        1 Reply Last reply
        0
        • K Offline
          K Offline
          ken536
          wrote on last edited by
          #4

          using DEFINES+=... in your QMake additional arguments line?

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            ah, bingo, that did it! Thanks a lot!

            (Z(:^

            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