[Qbs] QBS integration with QtC 'issues' and/or 'compile output' panes

Christian Kandeler christian.kandeler at qt.io
Fri Oct 27 10:39:20 CEST 2017


On Thu, 26 Oct 2017 19:33:35 +0300
Denis Shienkov <denis.shienkov at gmail.com> wrote:

> Let's imagine a situation, then we use a some custom utility to 
> pre-process a list of input source files (*.c, *.cpp). E.g. this utility 
> checks the source code on some errors (like a static analyser), and 
> prints out a numbers of lines, where it found some errors or warnings. 
> To use this utility, we in usual way add some Rule, which receives an 
> inputs: [ 'c', 'cpp' ], transforms it to output artifact, e.g. to some 
> file with results. As I said before, the utility also prints out a 
> results to the stdin/stderr, and I see this output inside of QtC 
> "Compile Output" pane.
> 
> So, my questions are:
> 
> 1) Is it possible to duplicate this warnings/errors to the "Issues" 
> windows, e.g. as it is done for compilers/linkers?

This magic is done inside Qt Creator using hard-coded parsers for the different compilers. So if you are writing this tool yourself, you should be able to make that work by emulating the error output format of either GCC or MSVC. Just take a look at what their error messages look like and use the same structure.

> 2) Is it possible that when I click on this 'issue' (as from "Issues" or 
> from "Compile Output" pane), automatically it gets to the appropriate 
> source file (to that line, where this issue occurred)?

Same as above. Use the same way of embedding line and column information as GCC/MSVC.

Note that there is nothing qbs-specific about this.


Christian



More information about the Qbs mailing list