Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you make QtCreator show cpp and header files together in left hand src tree?

Tags:

qt

qt-creator

The left pane in QtCreator shows the src file tree. All headers are in a seperate tree <headers>.

Both cpp and h files are broken down by dir structure.

My cpp and h files are allways together on the storage device. That is, each cpp file is in the same location as its matching h file.

I would like to see the h and cpp files not seperated into seperate trees in the left hand pane. How can this be done.

On hard drive, the project layout is as follows:

dirA
    a.h
    a.cpp
dirB
    b.h
    b.cpp

I use CMake and the project imports and builds fine.

The problem is that QtCreator displays the project as so:

    dirA
        a.cpp
    dirB
        b.cpp

    <headers>
        dirA
            a.h
        dirB
            b.h

I want to see this in QtCreator left hand src tree pane.

dirA
    a.h
    a.cpp
dirB
    b.h
    b.cpp
like image 306
code Avatar asked Sep 05 '25 05:09

code


1 Answers

Since Qt Creator 5 if you go to the "Filter Tree" drop down button, you can select "Hide Source and Header Groups".

See it in action here:

enter image description here

like image 138
Cristian Adam Avatar answered Sep 07 '25 23:09

Cristian Adam