Supporting the development of mobile applications is one of the main areas for improving Qt. Upcoming for release of Qt 5.3 and QtCreator 3.1, which, thanks to the support of WinRT, will allow you to run Qt-applications on new platforms. But without waiting for the release, you can now download Qt 5.3 beta and build your applications for Windows mobile platforms. New tools allow you to run applications in the emulator, and directly on the connected device. Because of this, today the author of the article (previously unfamiliar with the development of mobile devices) has collected the first mobile application in his life (albeit from the demos folder). This fact can be an argument in favor of developing applications for Windows Phone using the Qt toolkit. The article, in my humble opinion, will be of interest to both experienced developers of Windows Phone applications and programmers who have previously developed only Desktop applications using Qt.
Install the necessary software
1. First of all, you need to download and install Qt 5.3 beta for WinRT (qt-opensource-windows-x86-winrt-5.3.0-beta.exe file)
Screenshot of the installation window with the choice of components
2. If you have not yet installed Microsoft Visual Studio 2012 or 2013, you will need to download and install one of these versions. Microsoft Visual Studio Express 2013 for Windows Desktop and Microsoft Visual Studio Express 2012 for Windows are suitable for the purposes described in this article . Desktop . Note: if you install VS2013 Professional or Ultimate, then do not forget to include support for the development of Windows Phone applications in the installation options.
MSVS 2013 Express Setup Screenshot Screenshot
3. For Visual Studio Express, you also need to download and install the SDK you need from the Windows Phone SDK download page (since I had the Nokia Lumia 920 with Windows Phone 8 on board, I installed SDK 8.0, which also supports Windows Phone 7.5 ). It seems everything is ready, you can run QtCreator.
What's new in Qt 5.3 beta and QtCreator 3.1 RC1 for mobile Windows platforms
First of all, this is a new WinRT plugin (just in case, check if it is activated):
Now, when creating a new project, new lines appear in the drop-down list of template filters:
When creating a project, you can now select additional types of assemblies (the figure does not indicate the WinRT assembly, since this article does not consider it):
By launching the first type of assembly, the application will be immediately sent to the connected Windows Phone device, as shown in the video: ')
The second type of assembly (as the name implies) sends the application to the emulator:
Possible problems and their elimination
If the number of necessary components listed above is missing, then this red warning circle in IDE QtCreator will inform you about this:
But besides this, there are also glad other possible problems that are worth mentioning (and which the author has personally encountered). First, you will need to enable Hyper-V (if it is not already included). Guide: How to enable Hyper-V for Windows Phone 8 emulator The second thing that a developer may encounter is 2 error messages when starting the emulator:
Usually the developer has more than one virtualization program installed (similar to VMWare or Virtual Box). Since the emulator also uses the network interface, there may be a conflict with the network interfaces created by these programs. The problem is usually solved by removing these programs or more subtly, using the Hyper-V Dispatcher program, as described in Troubleshooting the Windows Phone 8 Emulator .
The third potential problem is directly related to Qt. Running the assembly for the device may receive the following message:
By opening the WMAppManifest.xml file, you can be sure that the ProductID is really missing: but in the assembly for the emulation of ProductID is written, so you can copy and paste it into an XML file: after that, the launch should be no problem.
I’m not quite sure if this is needed to run the application successfully on the device, but before building I registered the device (Nokia Lumia 920) using Windows Phone Developer Registration
It should also be remembered that during the deployment of the application, the smartphone must be in “active” mode, and not in blocking mode.
PS and here is the Qt-application icon in Windows Phone. All successful builds!