If the project backend supports it, you can add or remove files in your project without editing the project file.
Select the target where you want to add the new source file in the project view, click on the right mouse button to make the project context menu appear and select Add Source File.
Or from the main menu, select Project ▸ Add Source File
The target allows you to group files, and has a type which defines how the files are used inside. A program target contains source files, which will be compiled to create the target. On the other hand, a data target only groups data files which will be installed in the same place.
You can select another target in the top target tree view.
Click on the Select file to add button to get a file chooser dialog where you can select several files.
When you have chosen the target and the files, click on the Add button to add those files to your project.
Some project formats require the file to be under the project directory. Added source files outside the project directory are automatically copied inside to fulfill this requirement.
Select the file you want to remove in the project view, click on the right mouse button to make the project context menu appear and select Remove.
Confirm the removal. The file will only be removed from the project, not from your disk.
Got a comment? Spotted an error? Found the instructions unclear? Send feedback about this page.