How to create a new subfolder in your project in QtCreator

3513
3
08-12-2016 09:34 AM
JohnDye
Regular Contributor

I'm completely new to AppStudio and Qt and I'm really trying hard to get started, but the documentation is highly lacking. Anyway, I've downloaded some example apps and all of them have their initial <appname>.qml file importing another file from within a subdirectory in the project.

Screen Shot 2016-08-12 at 12.32.56 PM.png

In the above picture, MapViewer.qml is importing MapViewerApp.qml, which is located in a the MapViewer subdirectory.

I'm trying to figure out how to create a subfolder in the project through QtCreator but even Google is not giving me any helpful information because it wants me to edit a .pro file which doesn't exist in an AppStudio app.

Tags (2)
0 Kudos
3 Replies
nakulmanocha
Esri Regular Contributor

One of the easiest way to add a folder. Is to add it through file explorer. Show right click and do show in explorer. Just create a sub folder in the file explorer and it will immediately shows up in the project.

Qtcreator.jpg

JohnDye
Regular Contributor

Thanks Nakul,

So that's what I would have thought too, except that when I tried that on my Mac and selected the Add New option, a dialog opened that wanted me to select a file template. I didn't see any option there to just create a subfolder. There's also no context menu option to just create a new folder.

0 Kudos
JohnDye
Regular Contributor

So one of the things I've figured out is that I can create a new folder through Finder in the project's GUID folder, then as Nakul indicated, right-click on the 'MyApp' root folder in QtCreator, select 'Add New' and choose to add a new QML file. At that point, it brings up a file Browse dialog and you can navigate to the folder you created and drop the file in there. If you don't need the file, just delete it after doing so and that will add the Folder to the project.

Something tells me there's got to be a more efficient way of doing this though, so I'm going to keep this post unanswered in case someone does know of a better way to do it on a Mac.

0 Kudos