Creator project view shows lots of "unnecessary" stuff
-
Hi all -
I recently used the project wizard to create a Qt Quick project. The project view is cluttered with a lot of files I wasn't expecting to see:
This is the first project I've created in awhile - is this what I should expect to see? I have to admit I don't care for it.And, why are my .qml files listed in two places? (I created the ones other than main.)
Thanks...
-
@mzimmers said in Creator project view shows lots of "unnecessary" stuff:
This is the first project I've created in awhile - is this what I should expect to see?
Yes.
I have to admit I don't care for it.
Keep the
<Other Locations>
,..._other_files
, andCMake Modules
folders closed.And, why are my .qml files listed in two places? (I created the ones other than main.)
One copy is in your source folder. One copy is in your build folder.
This arrangement is necessary for CMake to auto-generate
qmldir
files for you. In the past, you wouldn't see "duplicates" like this, but you might need to manually write qmldir files instead (see https://doc.qt.io/qt-6/qtqml-modules-qmldir.html ). Which is not fun. -
@mzimmers said in Creator project view shows lots of "unnecessary" stuff:
@JKSH thanks for the explanation.
You're welcome!
So, what do I do in order to make my header files visible from the project view?
Add your headers as Source files, together with your *.cpp files.
-
@JKSH this is the section of the cmake file where the sources are listed:
qt_add_executable( appnga main.cpp resources.qrc clock.cpp )
I added clock.h to this list, and got a section in my project for header files, with clock.h in it.
So...how does this happen? Does Creator parse the CMakeLists.txt file and use its findings to create the project heirarchy?
-
@mzimmers said in Creator project view shows lots of "unnecessary" stuff:
So...how does this happen? Does Creator parse the CMakeLists.txt file and use its findings to create the project heirarchy?
CMake will export the header files in the file-api json structures that Qt Creator parses and creates the project tree.
See Qt Creator 6 - CMake update for some more details.
-
@davidovv said in Creator project view shows lots of "unnecessary" stuff:
it seams like projects view shows build folder instead of source folder. How can i change this?
To be precise, it shows the folders that are used by CMake.
Try clicking "Projects" (above the "qeycloak [master]" project tree) and changing it to "File System". Is that better for you?
-
No, that doesn't do it. If this behavior is not a bug, than it is a big disappointment. Why didn't they make another "build view" of project if they wanted to show build folder instead of tampering the one that worked... this is so "unnecessary" with no practical value
-
I hear what you're saying, but when you think of it, a project is at heart something that gets built, so perhaps it's appropriate to show everything that the build system relies on.
It's been a few weeks since I started this thread, and I hardly notice the "unnecessary" stuff anymore. I do like your idea about another view...maybe something to suggest for the next major release of Creator...?