Qt Creator Clang Code Model: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
Line 12: Line 12:
  $ qtcreator.exe
  $ qtcreator.exe


=== Internal command line (since Qt Creator 4.0) ===  
=== Internal command line ===  
The debugging output from above will contain all the command line options that are passed on to libclang, which is enough for most cases.
The debugging output from above will contain all the command line options that are passed on to libclang, which is enough for most cases.



Revision as of 10:29, 8 April 2016

Documentation: http://doc.qt.io/qtcreator/creator-clang-codemodel.html

Debugging

QLoggingCategory is used for debugging output. With the following invocation debugging output will be generated:

Linux/Mac:
$ QT_LOGGING_RULES=qtc.clang*=true ./qtcreator
Windows (start DebugView in advance to see the output):
$ set QT_LOGGING_RULES=qtc.clang*=true
$ qtcreator.exe

Internal command line

The debugging output from above will contain all the command line options that are passed on to libclang, which is enough for most cases.

However, to see also the resulting internal command line of libclang run:

  1. Open Menu: Tools > Options > C++ > Tab: Code Model
  2. Copy some warning configuration by clicking on "Copy...", give it a name like "Debug"
  3. Replace all the options from the copied configuration with "-###"
  4. Close and re-open the editor document - the new debugging output will contain also the internal command line

Note that libclang/clangbackend will crash afterwards, so do not forget to switch back to a sane warning configuration.