Generate doxygen documentation using Qt project file - qt

How can I tell doxygen to (only) use the files that are in my Qt project file when generating the documentation?
Reason for asking: I'm using a folder structure where a 'common' folder holds files that are used by some (not all) Qt projects I'm working on. Like this:
projects
MyProject
common_files
SubProject_A
SubProject_B
Both SubProject folders will have a Doxyfile and both projects will use some files from the common_files folder.
I know one way to achieve my goal (getting the documentation for just the files used in my project) is to manually add all files in the INPUT setting from the doxygen configuration file. But that would mean I'll have to change the Doxyfile every time I add or delete a file to/from my project.
Doxygen should be able to filter the files needed for the documentation from the .pro file. But how?

Related

How to automatically include Qt Linguist files into Qt resources for the CMake project?

I use CMake to build Qt project with internatiolization support. Using qt5_create_translation I can create *.ts files into the source directory and *.qm files into the build directory.
I want to reduce the number of files I should to distribute. Storing translation files :/translations/*.qm into the Qt resources is straitforward solution.
But during build process names of the resources are generated automatically and there is no native way to emplace them into the *.qrc file automatically.
How to achieve desired using, say, add_custom_command or something else?
Qt's qrc file is just xml files. Thus you can an external tool to add it.
A pure cmake solution could be:
Create a dummy resource file named #TRANS_FILE#
Add this file to your qrc file
Fetch the name of the translation file into a variable. Don't know how.
Use cmake's configure_file to replace the dummy resource name
Example:
set(TRANS_FILE ${NameOfTranslationFile})
configure_file(infile.qrc outfile.qrc #ONLY)

Qt Creator Beautifier and different projects

We would like to associate different kind of styles to different projects. I have been looking for and Qt Creator in its new version (4) has the possibility to autoformat files on saving using Beautifier.
My Question is if there is any way to associate for example a style file to one project to be opened when we open that project.
That file would be in the root folder of the project and would be downloaded automatically from the repository.
Looking at the 'Beautifier' options, I see that 'Artistic Style' and 'Uncrustify' has an option to use a file from the project directory as the style file. It's up to you to create these files for each project.
Update for clangformat: If you select the "File" option from the "Predefined Styles" list, clang-format should use a file from the project directory. For more info see the description for -style argument here.

Adding files inside a Creator project

I can add headers to the header path but how can I bring in external headers to be available within Creator for editing in project, so they appear in the file list like other headers created from scratch? in Xcode, you could just drag files into the project, they'd be copied into the project directory and appear in the IDE for editing. I'd assume you could do this in Creator but I can't find any way to do so.
Right Click on the project -> Add Existing Files... -> Choose your desired external headers
this way you can edit them (but it is not recommended to edit external headers)
Note: This way, the files will get compiled with your project, so you need to include all dependencies.
Use qmake - project from the command line in the directory containing the files and they will generate a .pro and you can copy that into a .pri and then include the .pri in your project, thus allowing you to access and edit the files from within Creator but segregating them nicely should you choose to use those files in other projects as well, but maintaining a single set of build and qmake settings.
If you add project headers to a target in CMakeLists.txt, they'll show up in Qt Creator.
file(GLOB HEADERS src/*.hpp src/*.h)
file(GLOB SOURCES src/*.cpp)
add_library(FreenectDriver SHARED ${HEADERS} ${SOURCES})

Qt including resource directory structure inside executable

I'm using QWebView to run a web app. There are 650+ files. Placing the web app's directory in the source directory does not result in the executable bundling the directory.
How do I include the entire web app directory so that the executable will be able to render the files.
Note: I have currently added index.html as a resource, and can access it with qrc:// - But since I cannot add the entire directory structure to a qrc (can I?), the executable does not include the other files.
You need to put an XML node into the .qrc file for each file you want to use using the Qt resource system.
This can be done using a simple pre-build script. Take a look at qrcgen. Quoting the blog post behind this link:
The script I created, qrcgen, takes a directory and a prefix, recursively scans the directory and generates a .qrc file with the same name as the directory scanned. It has solved my problem, and I hope it can help others. It is also available via PyPI, just "easy_install qrcgen".
In order to update the .qrc file whenever your directory contens change, you need to include this step into your build process:
For C++/Qt projects, you can add this step in the build configuration in QtCreator or add in your qmake file a system(...) statement. Note that such commands aren't portable in general. (If it's not portable, you can put some operating system conditions around multiple commands.)
For PyQt/PySide projects, I don't know how to do this, but I'm sure you find a solution for this too.

How to add .fsh/.vsh shader files to Xcode so they are added to Copy Bundle Resources phase automatically?

Whenever I add a new .fsh or .vsh OpenGL ES 2.0 shader file to my project's resources, the file is added to the Compile Sources build phase where it doesn't belong. I then have to manually remove it from that phase, and manually add it to the Copy Bundle Resources build phase.
Is there any way I can tell Xcode to add files with the extension .fsh and .vsh automatically to the Copy Bundle Resources build phase?
Or is it possible to create a Build Rule that has the same effect as adding the shaders to the Copy Bundle Resources build phase?
I would prefer a solution that works for all users of the Xcode project/workspace, rather than a setting or system change each Xcode user would have to play individually.
Following is a workaround I found. If anyone has any other solutions I'd still appreciate the answer.
What you do to get the shaders into the Copy Bundle Resources build phase automatically is simply to put all the shaders in a common folder (or folder tree). I named the folder "Shaders". Then when adding the Shaders folder select Create folder references for any added folders.
As folder references the files are automatically assumed to be Bundle Resources by Xcode. You just need to be careful not to place any unwanted files into that folder respectively clean up the folder before making a release build. Also loading the shaders requires to use the path to the shader files, ie "Shaders/Examples/Blur.fsh".
My workaround is that I go to File > New File > Others > Empty files and name them as shader.vertsh and shader.fragsh.
I guess Xcode automatically adds files with dot 3/4 extensions to compile phase.
And in case you're missing the Syntax Highlighting, change the File type to 'OpenGL Shading Language Source':

Resources