Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comments on .pro file Qt Creator

Tags:

qt

qt-creator

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.

like image 263
João Silva Avatar asked Feb 29 '12 11:02

João Silva


People also ask

How do you comment on Qt?

You can select multiple lines in the editor and then right click.. There is an (Un)Comment selection and the shortcut is Ctrl+/ either for commenting or for uncommenting a line.

What is the use of .pro file in Qt?

The purpose of a . pro file is to list the source files that are involved in a project. Since qmake is used for building Qt and its associated tools, it knows Qt very well and can generate rules for invoking moc, uic, and rcc.

Where is .pro file Qt Creator?

In the Qt Creator application, choose menu File->Open File or Project, navigate to the project folder and choose the . pro file to open.


2 Answers

You can comment lines by using a # symbol.

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

like image 168
shofee Avatar answered Oct 13 '22 23:10

shofee


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.

like image 23
StndFish Avatar answered Oct 14 '22 00:10

StndFish