[Qt-creator] project trees
Will Stokes
wstokes at gmail.com
Tue Oct 6 15:34:37 CEST 2009
> Ctrl+k :, Ctrk+k m, Ctrl+k c, Ctrl+k ., which do
> m => methods
> c => classes
> There is one shortcut that is even more usefull, that is F2, which
> simply is: Follow symbol under cursor. That is if the method, class
> implementation is actually used in the place you are currently working
> on, then navigating there is just ONE keypress.
> And that the normal case. It also works on #include lines and macros.
>
> In between those shortcuts, I haven't used the project tree for opening
> files for a long time, and have it acutally hidden.
These sound outstanding. I suspect I'll be able to do the same and use
the project tree less and less. That said, even on big projects there
is still a use case for project trees: diving into a glob of code (aka
multiples files, say a dialog) that you're new to. It's handy to be
able to see a listing of all the files that are related to that dialog
so you really get a handle on every aspect of the dialog. You could
blindly F2 around a bunch, but being able to look at a listing of all
the files for that dialog is quite useful still. It's also useful if
you're digging into a say a tools module and learning about the
classes it provides.
> I've asked for this before, for the exact same reasons. The consensus
> from Nokia seems to be that since you may want to edit the .pri files
> once-in-a-blue-moon, they should not be hidden.
If that's so that's a mistake. Since I've taken the time to develop
and extensive file hierarchy I end up having lots of this pri files in
my project tree, but I never actually edit them except maybe once
every two weeks, and even then, only just one of them. I really wish
there was a way to hide them all. Heck, I'd settle for a secret
keyboard shortcut for preference I could just add to the preferences
file. :-)
> Not sure about this. While are all your .pri files name 'files'?
This is pretty funny actually. I basically have a slew of top level
tools modules in my project. Thus my include structure looks like
this:
myApp.pro includes modules.pri
modules.pri has the following includes:
include( ../src/_fileDirTools/files.pri)
include( ../src/_generalTools/files.pri)
include( ../src/_generalTypes/files.pri)
Now these last three used to be:
include( ../src/_fileDirTools/fileDirTools.pri)
include( ../src/_generalTools/generalTools.pri)
include( ../src/_generalTypes/generalTypes.pri)
I noticed two things:
1) For modules with slightly longer names, you'd end up with very long
include lines that barely fit on the screen when say editing the pri
file from the console in an editor like nano. E.g.
include( ../src/_qtSolutions/QtSpellCheckingTextEdit/QtSpellCheckingTextEdit.pri)
2) It's stupid to replicate/type out those long names twice. Perhaps
this is too nitpicky, but it's just a heck of a lot easier to just
write the shorter form with "files.pri" instead, aka:
include( ../src/_qtSolutions/QtSpellCheckingTextEdit/files.pri)
An added bonus is that when you create a new module or subdirectory
you can use your existing files.pri file as a template of sorts, aka:
cp files.pri path/To/Subdirectory/.
if we used a name other than files.pri that would be:
cp QtSpellCheckingTextEdit.pri
path/To/Subdirectory/otherComplexNameThatMustMatchDirectoryName.pri
It's easy for the .pri file and the directory name to get out of wack.
What's perplexing is that I use XCode currently but my xcode project
is being generated for me by qmake and qmake is doing the right thing!
My project tree shows the directory names, not "files", for each level
in the project tree hiearchy. I just wish QtCreator could do the same
thing.
>> -Instead of having "sources" and "headers" sections repeated over and
>> over in the file listing, a single combo box at the top and support
>> for using F4 to switch between the header and source file listings
>> would be super and would also reduce a lot of clutter.
>
> Good idea. Still the best solution is virtual folders which Nokia is
> reluctant to implement.
What are virtual folders? I haven't used VS since around VS6 and if
that was around back then I didn't use the feature. It sounds too me
like some sort of manually created smart folder which just seems like
work but I guess I'm missing something.
Honestly though, the real thing that's keeping me from using
QtCreatorat the moment is double clicking files in the project tree.
That's ridiculous. It should be a single click. If that were fixed I
just might take the plunge and <shudder> rename all my files.pri files
to directoryName.pri, although I'd really hate to do that.
-Will
More information about the Qt-creator-old
mailing list