file or directory not found for "UIConstants.js" - qt

In Hamattan Application Project in Qt Creator. when I'm trying to import:
import "UIConstants.js" as UIConstants
I always get file or directory not found error after building. It tried to copy the file into my project, the same error pops out.
What could have gone wrong? Please Help, Thank you.

It's either of these two:
forgot to add it in res.qrc
it was located at a different directory(but is included in the project)

Related

Importing a JAR into SceneBuilder not working

I am using SceneBuilder-9.0.1 and trying to use JFoenix. While trying to import the jfoenix-9.0.1.jar with the JAR/FXML Manager (Library Managger), the following error appears:
I have no problems with importing FXML files though. The same error occurs if I try to import other JARs, e.g. controlsfx.
I think it's strange that the Scene Builder wants to copy the file into \Roaming\Scene Builder/Library because that's no valid file path, isn't it? Is there any way of coyping the file manually without using the Library Manager? And if yes, where do I need to copy the JAR file to? And is this a problem of SceneBuilder or of my PC?
Thanks in advance!

Adding ControlFX.jar file to build path

I am trying to install ControlFx for creating dialogs in my application. I have put controlsfx-8.x.x.jar file in the appropriate folder (lib/ext). It is the same folder where jfxrt.jar is present.
I am unable to add this jar to build path. The only option available is configure build path.
Can someone let me know what I am doing wrong?
Thanks
Controlsfx should not be put in lib/ext but simply added to your projects build path!

Qmake does not support build directories below the source directory

I have created an application that compiles and runs like a charm on OS-X. I would now like to start getting it to work on Windows. To start, I copied the project to a windows machine and just tried to compile, but got this error:
:: warning: Qmake does not support build directories below the source directory.
Any ideas?
Set the shadow build directory to some folder on the same level of your project directory:
folder/
project/
project-shadow-build-release/
project-shadow-build-debug/
You can do this in the "Projects" view, via the toolbar on the left. To me, this warning was just an annoyance, a project never failed to build because of it.
Don't copy your project.pro.user file when you are copying a project from one machine to another, or from one directory to another. When you open the project, Qt Creator will offer to create a new build directory in the proper place.
Andref gave the correct answer to resolve this warning, but you may want to understand why this requirement exists.
In fact, the build directory must be at the same folder level as the project (i.e. it can't be above or below). The reason why is that the linker is called from the build directory. Hence, any relative paths to library files will be different than what you entered in your project file.
It kinda sucks. I like to put all intermediate files in their own folder. But you simply can't with qmake.
.pro.user are generated files by Qt Creator. They are unrelated to qmake and should not be touched (and not put into a VCS for that matter)
Just remove the files with the pro.user extension , worked for me
I also got this, trying to compile a project created on linux.
Another way to solve it is to change the paths in the .pro.user file (in the directory of your project)
Right Click on a project: Set As Active Project
Click on the Projects button (The one with the spanner image)
Edit build configuration : Debug / Profile / Release / and change the default directories, OR just uncheck the Shadow build check box.
The Build directory path should now change to black, from red

Asdocs seems unable to find embedded assets

I'm running asdocs from a .bat file with flex sdk 3.2.0 (I have replaced my long project root folder with PROJECTROOT):
"C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\3.2.0\bin\asdoc" -source-path . "C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\3.2.0" "_PROJECTROOT_\Components\src" "C:\_PROJECTROOT_\assets" -doc-sources .
PAUSE"
Unforunately, I keep getting errors similar to this:
"_PROJECTROOT_\assets\styles.css(344): Error: Invalid Embed directive in stylesheet - can't resolve source 'Embed(source = "close_button.png")'.
downSkin: Embed(source="close_button.png");"
I really don't understand this as "close_button.png" is in the same folder as styles.css. When I build the project from within flexbuilder, it compiles it fine and does not throw any errors.
Does anyone know what I'm doing wrong?
It's not using your folder with the CSS as the root folder when it's working. It's looking for the assets in the folder you are running the commands from.
Try adding the assets folder to your source path.
I had a similar problem, and an answer I found elsewhere indicated to put a slash at the beginning of the asset path. That is, instead of
Embed(source="close_button.png")
rather
Embed(source="/close_button.png")

Missing file [Qt]

I'm successfully going through proccess of building an application in Qt but when I try to run .exe file by double clicking on it (outside of qt) I'm getting an error saying:
"The program can't start because mingwm10.dll is missing from your computer. Try reinstalling the program to fix this problem."
I checked for this file and I found it, so I think there is some path to be set in qt, but I don't know neither where and how to do it. Could anyone explain to me how to do it?
Thank you.
I think you need to add the directory containing mingwm10.dll to your PATH environment variable. I am surprised this was not configured correctly when you installed Qt/MinGW.
Control Panel -> System -> Advanced -> Environment Variables -> PATH
This isn't something that should be set in Qt. Your application is looking for a DLL it can't find, mingwm10.dll. You can either copy the DLL (and it's dependencies if there are any) near your .exe, or add the directory it's in to the environment variable PATH.
You can go to the location where your Qt application is installed and then navigate to "..\Qt\5.11.3\mingw53_32\bin" directory. The search for the missing .dll files, copy them to the location where your .exe file is situated and then re-run the application. If more than one files are missing try the same for them.

Resources