I'm new to Qt creator, so when I want to add a prefix folder to my qml.qrc file just nothing happens!
I right-click on the "qml. qrc" file and press "Add Prefix...", then choose my folder name like "folder", then press "OK", But nothing happens!
please help me, I think my app has a problem with its installation, hope I'm mistaking!
my OS = windows10
my QT = Qt creator 4.15 based on 5.15.2
Select qrc and select open in Editor
Select add Prefix
Then you should add File to see prefix name in project I add icon
4.Press Ctrl + S , and Save Project you will see it :
Related
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.
Further notes
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.
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.
I have an existing QT Creator project. I want to add an entire directory to this project. I see that I can right click in the project file browser tree and "Add Existing Files..." However through this dialog box, I can only add individual files. How can I include an entire directory?
The simplest way is to directly edit your .pro file, add HEADERS += mydir/*.h and SOURCES += mydir/*.cpp and the contents of the whole directory will show up in QT Creator. Further reference: http://qt-project.org/doc/qt-5/qmake-project-files.html
Open a terminal, navigate to the folder where you want to have you project file, and then run the command
qmake -project
This will search the current directory and all subdirectories for files with extensions such as .c, .cpp, .h, etc. (the full list is found by typing man qmake).
But keep in mind that it will overwrite your current .pro file if you already have a project set up.
qmake provides a convenient files function for this very purpose. Adding the following line to your project file will add .cpp files inside the src/ directory:
SOURCES += $$files(src/*.cpp)
By default, this is non-recursive. Setting the second parameter to true recursively finds all files:
SOURCES += $$files(src/*.cpp, true)
The files function was introduced since Qt 5.10.
Nowadays you can just right click on project name and select Add existing directory
I want to add libboost_filesystem.dylib to my Xcode target as a library to link to, but Boost is installed in /opt/local/lib.
/opt is hidden and not accessible from the open panel, so I cannot select the dylib:
How can I add the library to my target?
Cmd-Shift-G in any open dialog under OS X triggers "go to folder" (in which you can enter any path). Alternatively you can open /opt/local/lib in the Terminal (which opens the folder in a Finder window), then drag the library into your project.
You can first make the finder show all files.
Maybe "defaults write com.apple.finder AppleShowAllFiles -bool true" will be worked.
My problem is simple.
How do I add an icon that appears in Windows Explorer ?
Not the specific window I want the whole application like the command prompt has the C:\ on the icon.
Is there any way I can do that without creating files and linking it to the .pro file ?
Can I change that base icon in the Qt Creator ?
If so, how ? If not how do I do it otherwise ?
Thank you
PS I have tried the other questions out there and none of them work at all
Basicaly, on Windows, you have to create an .rc file for your icon and then add a line in you .pro file for it :
RC_FILE = myapp.rc
All the details are available in Qt Documentation: Setting the Application Icon
In Qt 4, you need to create a .rc file like this:
IDI_ICON1 ICON DISCARDABLE "myIcon.ico"
You should add this to your .pro file :
win32: RC_FILE += MyApp.rc
In Qt 5 there is an automated process for setting an icon to the application executable file .
You can just add the following to the .pro file:
win32: RC_ICONS = myIcon.ico
Also store the .ico file in your application's source code directory.
Note that this is only for Windows. There are other ways to set application icon in Linux and Mac.
Please help me with solution of how to set the app icon for exe file on windows mobile platform? It means that icon should displays in explorer, task manager and so on.
This might be of helpful to you.
QApplication::setWindowIcon
In Qt 4, you need to create a .rc file like this:
IDI_ICON1 ICON DISCARDABLE "myIcon.ico"
You should add this to your .pro file :
win32: RC_FILE += MyApp.rc
In Qt 5 there is an automated process for setting an icon to the application executable file .
You can just add the following to the .pro file:
win32: RC_ICONS = myIcon.ico
Also store the .ico file in your application's source code directory.
Note that this is only for Windows. There are other ways to set application icon in Linux and Mac.