Comments on .pro file Qt Creator

2020-03-12 03:24发布

问题:

Is there anyway to comment certain sections of my .pro file (Qt project)?

In my case I want to comment specific parts that do not apply to the platform I'm currently targeting.

Found this now: http://doc.qt.io/qt-4.8/qmake-project-files.html.

回答1:

You can comment lines by using a # symbol.

In the .pro file, # before any line or statement indicates a comment.



回答2:

you have to place a # at the begin of each line.



回答3:

I think Silva is looking for something like this in .pro file:

if(false) {
    ...
    your block
    ...
}

This is the programmatic way to do commenting, and you have control of it. Similar approaches may available for other test functions.



回答4:

If using QtCreator, highlight the section you wish to comment out, then right click for context menu and select 'Toggle Comment Selection'. This is good for large blocks code to comment out.



标签: qt qt-creator