Reputation: 11732
Let's say my project is called foo
. I created a subdir called subdir
in the foo
root, using Windows Explorer. I put my main.qml
file in subdir
. Then I tried to do a project-wide search for "text" in my project. To do this, I pressed Ctrl+Shift+F
, selected Project "foo"
in Scope
, wrote "text" in Search for
. No matches were found, though main.qml
does contain the string "text". When main.qml
is in the project root, the string is found just fine.
Is this a bug in Qt Creator and is it something I can fix in the options?
Qt Creator version: 4.1.0.
The .pro file doesn't include main.qml, but the .pro file contains RESOURCES += qml.qrc
, and qml.qrc contains <file>subdir/main.qml</file>
. The project viewer in Creator does show main.qml in the tree, nested as "Resources -> qml.qrc -> / -> subdir ->main.qml".
If by "project focus" mean it has to be the "Active project" as set by rightclicking a project and selecting "Set 'myproj' as active project", then I have that requirement fulfilled.
I tried including in the project a resource file (called "main2.qml") that resides in the project root, just so I can see if it gets included in the .pro automatically. It did get included, like this:
DISTFILES += \
main2.qml
And, weirdly, now that I included this new file, the old file that resides in a subdir is also searchable.
Even when I removed main2.qml from the project, the files in subdirs remained searchable! They even became searchable in my other project, where I've changed nothing!
Very weird. I expect soon search will start having the problem again, so I'd still like tips on what might have caused the problem.
Upvotes: 1
Views: 344
Reputation: 98495
Make sure the qml file is a part of the project.
A project-scope search only looks in files that are a part of your project. Their on-disk location is not relevant at all. If they don't show up in the project tree, they are not in the probject, period.
Make sure that the File Pattern for the search includes the qml files.
The file pattern elements are comma-delimited (e.g. *.c*, *.h, *.qml
). It is a common error to use other delimiters.
Upvotes: 0