Autocompletion doesn't work when using precompiled headers



  • As far as I have searched throughout the existing Qt forum threads, someone has already complained about this problem:
    https://bugreports.qt-project.org/browse/QTCREATORBUG-476

    The bug report states that the bug has not been fixed yet, but the comments read that the Qt Creator's plugin named Qt4ProjectManager has been fixed to provide autocompletion for project that have precompiled headers enabled.

    The Qt documentation that targets precompiled headers: http://doc-snapshot.qt-project.org/4.8/qmake-precompiledheaders.html makes obvious that there is no need to include the precompiled header at the top of all compilation units (cpp, c, mm, etc files) - the cpp files in the sample project do not include this precompiled header file.

    In the current situation, it should not be correct to include the header file that represents the precompiled header at the top of all compilation units (cpp, c, mm, etc files) since the project builds without the need for including the precompiled header.

    What is the best way to fix the problem - include the precompiled header file on top of all compilation units?



  • I don't think that's really a bug that need to be fixed, because when you disable the precompiled headers, the compilation should still be working.
    You shouldn't rely on the precompiled header being included automatically to your compilation units but rather include the headers that are strictly needed for a regular compilation.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.