Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-22584

QtCreator keeps forgetting about Additional Preprocessor Directives

    XMLWordPrintable

Details

    • Windows
    • a8397c129f (qt-creator/qt-creator/master) a8397c129f (qt-creator/qt-creator/9.0)

    Description

      QtCreator doesn't consistently apply the Additional Preprocessor Directives (e.g. Tools -> C++ -> Additional Preprocessor Directives, or the `#` icon at the top of an editor window) when parsing a file. Sometimes the file is parsed as if the additional directives aren't present.

      For example, if you have `#define FOO` in the additional preprocessor directives and your file has a `#ifdef FOO` section, sometimes that section will be greyed out and symbols defined in it won't be searchable.

      One reliable way to trigger this problem is:

      1. Open a file with a `#ifdef FOO` section in the editor (can be any symbol, doesn't have to be `FOO` specifically).
      2. Add `#define FOO` to the Additional Preprocessor Symbols for the file, so that the ifdef'd section is not grayed out.
      3. Close and reopen QtCreator, then reopen your last session.

      The ifdef'd section in the file is now grayed out, even though the `#define FOO` is still there in the additional preprocessor directives.

      I sometimes see this happening simply while editing in QtCreator too, not just when I restart it. The problem occurs with both qmake and cmake projects.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            vilya Vilya Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes