简体   繁体   中英

Create folders/subfolders in an qt creator project

In my Qt Project, I want to create some subfolders like Audio or Video .
Something like this:

Project\Media

Project\Media\Audio

Project\Media\Audio\Video

How I can do this?
Is there an way to add a new folder in Qt Creator? Or do I need to create this manually via the explorer?

Currently the only way is to add or create file that is inside of the directory - then the directory will be also created in Projects view of the QtCreator. This is not really that bad, since you can create directory while adding a new class file to the project. When the file is added to the project, also all its parent directories will be reflected in the Projects view.

In qt you use mkdir

bool QDir::mkdir ( const QString & dirName ) const

which will create a subdirectory called (variable dirName)

You could also use cmake which allows you to generate makefiles for every platform you need, itsteand of writing them manually. See code examples here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM