8
votes

I am trying to add a c++ file to a existing Qt project but I can't make the name of the c++ file start with a capital letter. E.g. DownloadOsm.cpp becomes downloadosm.cpp automatically using the wizard.

3
You could probably add it to the appropriate .pro or .pri file manually.Steve
You can build a Qt project manually, e.g. by having your own (small) MakefileBasile Starynkevitch

3 Answers

11
votes

To solve this issue do the following:

[Tools] -> [Options] -> [C++] -> [File Naming] -> uncheck "Lower case file names"

1
votes

This is indeed the case when you try to use the wizard to add new C++ Source File or C++ Header File. For those wizards - I could not find the way to make the names to follow the name convention you chose for your class name.

However, I found that when you use C++ Class wizard, it allows you to edit the names of header and source files. So, I try to only use the C++ Class wizard, it saves me time to rename just created files and is quite convenient for my purposes.

Qt wizard new C++ class

-1
votes

I made a .cpp file which satisfy your conditions in the following way:

Create .cpp file

Open your Qt project directory and create a new .cpp file (DownloadOsm.cpp)

Add to project

Open your project (.pro) file in Qt Creator and right click on the Sources subfolder and select Add Existing Files from there choose your .cpp file (DownloadOsm.cpp)