[Qt-creator] Configure Qt Creator for Windows Phone
Knight Andrew
Andrew.Knight at digia.com
Sat Mar 22 22:54:58 CET 2014
Hi,
> Hello Andrew
>
> I've tried the beta http://download.qt-project.org/snapshots/qt/5.3/5.3.0-beta/2014-03-22_26/ with the animated tiles example and it works without any problem. Qt Creator detected the kits, SDKs, compilers... I just opened the example, pressed run and it executed
> in the phone. Congratulations for a very good work!
Cheers :)
> Then I tried a Qt project I'm working on. It compiled without any problem but when it tries to run it I only get the following output in console:
> winrtrunner --profile xap --device 0 --install --start --stop --wait 0 C:/DevelopmentProjects/MakeFiles/build-FillGame-Qt_5_3_0_for_Windows_Phone_8_arm_MSVC2012_32bit-Release/release/FillGame.exe
> qt.winrtrunner: Using the Xap profile.
> qt.winrtrunner: No mapping file exists. Only recognized files will be packaged.
> qt.winrtrunner: Unable to install application. "?"
Uh-oh. That "?" means we failed to properly parse an error code. Could you please run the same command from a command prompt, but with --verbose -2 added after winrtrunner? That will help debug the issue.
A failed installation could mean any number of things.
> winrtrunner returned with exit code 3
>
> How can I create a mapping file?
The mapping "spec" is documented here: http://msdn.microsoft.com/en-us/library/windows/desktop/hh446767.aspx#create_package_using_mapfile
We're working on building that into Creator, though.
> Also, I tried to put a couple of #ifdefs, but I could not make it work with #if defined (Q_WS_WINRT) nor with #if defined (Q_OS_WINRT), what macro should I use?
Q_OS_WINRT is correct. Q_OS_WINPHONE is also defined for Windows Phone.
> My project has some data files so I added to the .pro file:
> winrt{
> font.source = ../../Data/Fonts/DroidSans.ttf
> font.target = Fonts
<*snip*>
> INSTALLS += font episodes_data episodes_bg sounds fggraphics gfx
> }
> But I think it did not work, as I did not find the files copied in the output directory. Where can I found some documentation about installing files in the device?
Well, nothing is handling INSTALLS on this platform yet. We plan to solve this by adding the content of INSTALLS to the appx mapping file.
At the moment you may use DEPLOYMENT instead, but it only works with Visual Studio:
fonts.files = fonts/DroidSans.ttf
fonts.path = fonts
DEPLOYMENT += fonts
> Finally I added the files, zipped them and installed via xapdeploy and the program only starts and then crash without showing anything. I am new to Windows Phone development, do you know if it's possible to write a log to a file and examine it?
Currently, your best option for debugging is still Visual Studio. Generate a vcxproj like this and open it in VS:
qmake -tp vc CONFIG+=windeployqt
Logging to a file is possible (e.g. by installing a message handler and writing all messages to local storage). Then there is the trouble of getting the file off the device... we already do this for test cases, but there's no way to do this for normal apps at the moment. We have real-time debug output on WinRT apps, but such support for Windows Phone is still an open issue (https://bugreports.qt-project.org/browse/QTBUG-37308).
So, it can be done, it hasn't been done (yet), and therefore it's generally better to use VS until we get there.
But hey, great to see you trying out the experimental plugin! We do truly intend to get the point where VS is no longer a necessity on this platform; we just aren't there yet :)
HTH,
Andrew
On Friday, March 21, 2014 2:15 PM, Carlos <aarkham2k3 at yahoo.com> wrote:
Thanks Andrew
I will try again with the next beta.
Carlos
On Thursday, March 20, 2014 3:31 PM, Knight Andrew <Andrew.Knight at digia.com> wrote:
Hi,
Carlos wrote:
> Hello
> I have tried to compile the animated tiles example for Windows Phone 8 with the beta downloaded from
http://download.qt-project.org/snapshots/qt/5.3/5.3.0-beta/2014-03-19_21/
> The first problem has been the Kit, Qt Creator detected visual studio and added a kit for Windows Phone 8, but it was configured with the Device type as Desktop and I cannot change it.
Known issue (https://bugreports.qt-project.org/browse/QTBUG-37618).
Fixes for this have already been submitted, so it will shouldn't be there in the official Beta.
> So, I added a kit manually and it started to work, but it could not find windeployqt or winrtrunner. I solved this adding the path to PATH, but I don't think this is the right solution.
Strange... this should have worked even with manual kits.
> Then the example compiled but it failed in the linking phase. It could not find an object file (sorry, I do not remember the name) and I solved it adding a LIB environment variable.
Again, a bit strange. We haven't seen this problem. If you see it again, let us know.
> Now, the example compiles, but the a dialog box appears wit the title "Custom Executable" and asks for an executable. I didn't know what executable and parameters was asking for, finally I put windeployqt and it make it work.
This shouldn't happen if the WinRt plugin is enabled and/or you haven't set the kit's device type to "Windows Phone". As it's disabled by default, check that it is enabled (Help->About Plugins).
> Last, I had to zip all the files and rename them to .xap and deploy it with xapdeploy.exe and it works in the phone!!!
Great, but you shouldn't need to do this. The plugin (or winrtrunner, more precisely) will do this for you.
> How can I configure QT Creator to do automate all of this? I'd like not having to put environment variables that are for the phone but I have to change for the emulator, create the .xap file and deploy the program.
By getting the kit to use the Windows Phone device type, as described above.
Note that there is no debugging support or debug output yet for Windows Phone, unfortunately. So, while it's not hard to get something running, chances are you'll need to fire up Visual Studio to do anything serious with the Beta.
Thanks for the feedback and good luck going forward :)
Cheers,
Andrew
> Thanks in advance
> Carlos
_______________________________________________
Qt-creator mailing list
Qt-creator at qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator
More information about the Qt-creator
mailing list