Problems Compiling QML app in Visual Studio
-
Where can I find the .dll files I need?
-
It's in the bin folder of your Qt installation.
Since you're using MSVS they are probably in C:\Qt\insert-your-version\bin
-
If you are using the debug build, you should link against the debug libraries: QtCored4.dll and QtGuid4.dll and QtDeclaratived4.dll
-
Forgive my newbie questions but how do I go about linking those files in Visual Studio 2008?
Also any ideas for how to get the fonts to look the same as they do where I developed them in OS X?
-
Perhaps we need a wiki about libraries being in PATH or including them with the app in a redistributable form.
As for the fonts: Qt tries to use system font by default (to give native look among other things). This includes font face, size and (quite importantly) anti-aliasing.
If you want to override the system font, you should pick the font you want to use manually in your application. If you've already done this, you might be referring to anti-aliasing then? -
I have picked the font manually in QML. Arial Bold for everything, but every font appears about 2x the size in the windows exe.
-
Have you changed "font.pixelSize":http://doc.qt.nokia.com/latest/qml-textinput.html#font.pixelSize-prop or "font.pointSize":http://doc.qt.nokia.com/latest/qml-textinput.html#font.pointSize-prop for your elements?
-
font.pixelSize, do you I have to go through and change them all?
-
I fixed the font issue but I am still having problems running the .exe. I put all the .dll files in the release folder and now when I run the .exe I get a blank window. Any ideas?
-
Could be it does not find you .qml file?
-
I don't think so, it still works great if I run it through Visual Studio, it only gives me the blank window when I try to run the .exe straight from the release folder. Very frustrating.
-
kyleplattner, where does you qml located? if you just have it in sources and use relative path to it when you should check that this relative paths are ok relatively to exe file.
-
Then probably something else is not found. Unfortunately I never created a QML app on windows, so I can't help further.
If you don't mind, you could provide a ZIP with a complete sample of your code, so we could test it on our machines.
-
All of my QML files are in the same directory as my main.cpp along with the release and debug folders.
-
kyleplattner, place them in one folder with .exe.
-
Dennis, I followed your advice and it worked. Everything is in the same folder and it runs. Now how can I send the .exe off to management and get it to run on their machines.
-
Or, better, embed it in a resource file (.qrc).
-
How do I embed it in a .qrc, what will that do for me?
-
[quote author="kyleplattner" date="1291650391"]Dennis, I followed your advice and it worked. Everything is in the same folder and it runs. Now how can I send the .exe off to management and get it to run on their machines. [/quote]
Unfortunately, this might not work on non-development machines. It could be that the C/C++ runtimes for your particular version of Visual Studio must be installed on the client's computer. If you have to install it depends, if it was previously installed by some other software or not. Anyways, it does not harm, if you run that vcredist_x86.exe again, it does not install the libs twice.
-
If you will have qml files in resource then you will not need to copy them with your exe, they will be inside it.