How do you return a list of the current project folders and files of your project?
So I posted this on Ask Ubuntu http://askubuntu.com/questions/55394...of-your-curren
And would love to share any answer there.
I hope my question is straightforward enough to understand. All I want (best case scenario) is a function that will return a list of the active project's files and folders. I will settle however if a list of all the files in the sidebar are returned.
Thanks !
Re: How do you return a list of the current project folders and files of your project
Your question does not indicate where you need that information.
Are you writing a QtCreator plugin and/or extending an existing one and are asking how to access the project details?
Cheers,
_
Re: How do you return a list of the current project folders and files of your project
Thanks for your reply!
I am writing a QtCreator plugin, and I am asking how to access the project details.
So in essence,
tools>myPlugin>run
should return a qstringlist of all the files/folders of my current project. I think from that I should be able to construct the rest of the plugin.
Re: How do you return a list of the current project folders and files of your project
Maybe some approach like this will work:
- get hold of the project explorer instance
- ask it for the current project
- ask that for its file
Cheers,
_
Re: How do you return a list of the current project folders and files of your project
Any idea of how to get hold of the project explorer instance?
Re: How do you return a list of the current project folders and files of your project
The PluginManager has an instance() method and several getObject methods.
The ProjectExplorerPlugin has an instance() method.
Cheers,
_
Re: How do you return a list of the current project folders and files of your project
I do apologize for not being a terribly apt c++ programmer, but would you mind providing a small code snippet?
Re: How do you return a list of the current project folders and files of your project
Well, I am not sure you will succeed in your endeavor if you already have difficulties with C++ basics like calling a method.
Code:
const QStringList projectFiles
= ProjectExplorerPlugin
::currentProject()->files
(Project
::ExcludeGeneratedFiles);
Cheers,
_