PDA

View Full Version : Files added to the wrong .pro file



ComServant
13th February 2013, 04:30
I have my .pro file, GameClient.pro, and I have several other .pro files included by GameClient.pro using "include(myOther.pro)".

When I create a new file in QtCreator (.cpp or .h), the file is added to one of the other .pro files, and I can't figure out why (this is with QtCreator 2.6.2).

8711

I'd have thought that it'd be added to the main .pro file (the actual "project" loaded by QtCreator) not the .pro files that QtCreator merely detects as include()'d by the main .pro?

Does anyone have any awesome insight into this? =)
Thank you for taking the time to read my problem.

ChrisW67
13th February 2013, 04:43
The PRO file used depends a little on where and how you added the new files, which we cannot see in your screen shot. However, if you used the Qt Creator Add New.. then you are prompted to select which of the PRO files in your project the files are added to. It defaults to the PRO file matching the project folder you opened the context menu for or, if you used the File menu, the project containing the current open file.

The convention of naming included files *.pri is probably of assistance here because Qt Creator will not generally modify these.

ComServant
13th February 2013, 18:00
Thanks, I hadn't noticed the drop-down in the wizard.
Since these .pro files are in the same directory, it must've been choosing API_Boost52.pro first because of alphabetical order.

Renaming them to *.pri worked. Thank you very much!