Latest version of QtCreator out of the box installs only Qt 5.0+. That’s rather obvious, but what if someone wants to play a bit with previous edition? Yeap v4.8, the one that is almost 4 years old! It is still doable and I will shortly show the way. Move to TL;DR if you are not interested in the background story.

You could ask why I wanted to do that in the first place, so here is the reason. I am still using a BlackBerry smartphone with BB10 OS onboard. And it’s much easier to develop (and test) a “meaty part” for a native app using the desktop edition of Qt in QtCreator and then only bind it with the UI using Momentics IDE than write everything there and deploy all the time on the device. This is much slower and tiring process, especially when the BB10 device emulator doesn’t work on Windows 10 with Hyper-V enabled…

Let me stop you here, before you start complaining about it. Although the BB10 platform itself is dead and abandoned, the same code can be used to develop Android apps (and of course UWP etc…), so not everything seems to be the waste of time. Download the NDK using Android Studio, use the MaintenanceTool.exe (from Qt installation folder) to add required architecture crosscompilers support and configure the paths, kits and deployment targets in QtCreator with this short guide.

Really, after all you will be much happier person, that Qt is the framework that binds all platforms together.


So how to add Qt 4.8.6 support?

1. First and foremost – Qt installation is required! You can obtain the free version for open-source projects from here. Select the options that suits best and simply install it. I used “C:\Qt” as destination path.

2. From Qt archives download the Qt 4.8.6 installer. I am not going to install VS2008 nor VS2010 on my machines anymore, so I went for MinGW-based version. I recommend using “C:\Qt\4.8.6” as the destination path, as it will be next to 5.10.0 version and will also simplify further configuration.

3. Matching MinGW compiler can be downloaded from here (ended at location: “C:\mingw32”)

4. Launch QtCreator and open “Tools –> Options”. Now we need to define locations for all the compilers, debuggers etc.

5.  Add new Qt Version. Use the ‘Add…’ button on the right and navigate for qmake.exe in 4.8.6 installation folder.


6. On “Compilers” tab add new MinGW C compiler (gcc.exe).


7. Then add MinGW C++ compiler (g++.exe).


8. On “Debuggers” tab add appropriate GDB from MinGW folder.


9. Finally on “Kits” tab bind all the tools added in steps above.


10. Voilà. Now the newly created kit can be using to build future projects.


It might happen, that the application won’t start. It’s mostly because there are some DLLs the output executable depends on (like: QtCore4.dll, QtNetwork4.dll, libgcc_s_dw2-1.dll, libstdc++-6.dll, libwinpthread-1.dll or their debug editions). The easiest way is to copy them from Qt 4.8.6 installation directory into the debug-build folder (i.e.: <project>/../build-<kit>-<platform>/debug) manually, setup it up as a post-build step or make the DLLs generally visible by adding Qt 4.8.6/bin folder into PATH environment variable.


In my recent post I have shown, how to track web requests issued against remote server I don’t have a control over. Curious reader could ask at this point – but what have I broken this time? And the answer is as usual – personally did nothing wrong, I was just doing my job. I had to port some HTTP related code from using Windows Runtime-specific HttpClient (i.e. Windows.Web.Http.HttpClient) to also work outside the sandbox on a regular .NET 4.5 desktop version and start using System.Net.Http.HttpClient instead.

Then I noticed that everything worked fine except multipart form-data submissions using POST method that were behaving unexpectedly bad (timeouting or returning an error immediately). There was nothing unusual mentioned on MSDN, so I started to compare sent requests using both implementation. It turned-out of course, the problem lied deeper in the framework in a value serialized as a *boundary* part of the Content-Type field. HttpClient from the System.Net.Http somehow was adding extra quotes around it, while the one from Windows.Web.Http didn’t. Even though server should accept both values (according to RFC2046 section 5.1.1), it actually didn’t and was waiting for correct *boundary*.

Simple fix by manually overwriting the guilty header can look like that:

var request = new HttpRequestMessage(HttpMethod.Post, url);
var boundary = "--" + Guid.NewGuid().ToString("D");
request.Content = new MultipartFormDataContent(boundary);

// fill content
// ...

// update the Content-Type header to be accepted by the server:
request.Content.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary);

// send request:
var result = await _client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, token);


World saved. Job done!


With the recent announcement of Visual Studio 2015 RC you, as a developer, are now able to write applications targeting iOS, Android and of course all kinds of Windows platforms, web and cloud. I am also pretty solid, you will be happy to hear, you can make your applications run on BlackBerry devices (including PlayBook!) as well. I just recently updated integration of the BlackBerry Native Development plugin with latest version of Visual Studio, so you can stick to your favorite IDE and continue coding without lowering your productivity. Grab it directly from Visual Studio Gallery, to be always up-to-date, when new releases are published in the future.

Notice that this plugin supports wide range of Visual Studio versions, from 2010 till the most recent ones now.


The current state includes features like:

  1. dedicated "New Project" and "New Project Item"

    New Project wizard preview

    New Project Item wizard preview

  2. automatic MSBuild update (without any manual plumbing) on new version releases

    MSBuild notification

  3. GDB integration

    GDB preview

  4. IntelliSense support

    Runtime IntelliSense preview

  5. Qt 4.8.3 for PlayBook support via dedicated set of NuGet packages
  6. QML basic colorizing support

    Runtime QML colorizing preview

  7. device browsing support

    Device browser preview

  8. dedicated settings to tune all aspects of project build and deployment

    Project settings preview

    Global settings preview

  9. support for C++0x and C++11 features (limited to OpenGL applications)
  10. and much more!
    This package provides Native SDK, Qt and Cascades support inside Visual Studio for PlayBook and BlackBerry 10 devices. It encapsulates whole development cycle - from developer registration, via coding, deployment, debugging, until the final release to AppWorld marketplace.


There are for sure some bugs or things you could wish to be improved. So don’t hesitate and let me know about it. You can always contact me directly, twitter @CodeTitans or submit a feature request on project’s website. Please only take into account, this project is **not** sponsored by any company (BlackBerry nor Microsoft in particular) and I do it only in my spare time, when not working for food!


Although the PlayBook tablet was totally abandoned by BlackBerry long time ago and there are other problems around the company I still wish them well. That’s why I continuously support the BlackBerry Native Development plugin for Visual Studio. Recent additions were about Visual Studio 2015 RC and most notably PlayBook and Qt-4.8.3 support. I hope it will inspire you and myself to write some applications on it.

Thankfully lack of support from BlackBerry is the best thing they could do to PlayBook. It’s OS software is not bloated with useless features and even if you count it to be 4-years-old tablet with only 1GHz clock and 1GB of RAM applications run fast and fluid. Most notably it’s now so damn cheap to buy, if you plan to do some IoT, that it compares with Raspberry Pi 2 and has SD and screen already attached.

The problem however is lack of a common UI framework that could work out-of-the-box. Until now. BlackBerry tried to support few approaches to enable developers. One was Adobe Air, but somehow I am not so keen to port anything to ActionScript. Another one was Android Runtime to let do some Java programming. This was better, but the best option to me appeared their involvement in Qt framework (and more here). This allows going down to the bare C/C++ coding for maximum efficiency etc. Officially the last version dedicated to PlayBook was Qt-4.8.3. Unfortunately it was never published and never integrated with any IDE. They probably moved all forces to support upcoming BB10 platform at that time.

If you look closely on PlayBook NDK 2.1 you will find some Qt libraries in it, but they don’t tend to work (maybe because the lack of platform-specific libblackberry.so included?). There is even officially published guide, how to build it from sources on Linux machine. I however learnt more from improved versions created by community around how to integrate it with Momentics (more here) and build and tried it several times on my own. As a result I even prepared my own guide, how to build it on Windows. But please, being serious, who wants to do that before writing application? Answer is obvious – no one. There should be no barrier like that and if you count them all, you will know, why BlackBerry failed in the Mobile World War. I always say – small things to matter.


What I really did? I enabled basic Qt types of project via BlackBerry Native Development plugin inside Visual Studio. There are 2 simple steps (assuming you have the plugin configured and NDK 2.1 installed), but I will work on improving it and making down to 1:

1. Create new project in Visual Studio 2013: File –> New –> Project… –> BlackBerry Projects –> Qt –> PlayBook Qt4 Core Application


2. make sure following NuGet packages are installed:

* codetitans-playbook-qt4-core – that injects base libraries into the project (and bar-descriptor.xml) and setups headers for successful compilation

* codetitans-playbook-qt4-qml – it will enable QML development inside the application (QtQuick) and actually let you compile samples from Qt website.

Are there any issues?

Sure they are:

  • First and the biggest is that all .moc files have to be created manually (tools for Windows available here). I am working on another NuGet package that will fix it, but it’s not finished yet.
  • Compilation might generate lots of warnings like: “warning : the mangling of 'va_list' has changed in GCC 4.4”. This can be disabled by adding this switch “-Wno-psabi” for the compiler (Project properties –> C/C++ –> Command Line –> Additional Options).
  • The final .bar file deployed for device can be quite big (~20MB at startup) as all required Qt libraries need to be included.
    There is a workaround to put them once to the user’s home folder, when doing development and skip placing them in a .bar file for that time, but haven’t verified it yet.

Post scriptum

This whole project started mostly as a result of my IoT midnight plays and lack of real file manager for PlayBook. Thankfully I found very old project from Kevin Boone named kfile. He also created an introduction, how to make Qt apps on PlayBook and was so kind to share sources. I test the NuGet packages and Visual Studio plugin against this code and plan to publish it in AppWorld shortly.


I wish to say many thanks to Lou Gazzola and Dave Burgess for their help in making the Visual Studio plugin for BlackBerry named Gold 3.0 to be completed and released publicly. There was a dedicated interview with me, published on BlackBerry Dev Blog, which can be found here, which makes me proud a lot. Also I am really grateful for granting me the latest BlackBerry Passport mobile and inspire for further plugin and own apps development.

Hope to see you guys in the future with upcoming new features!