Porting Qt Applications to BlackBerry 10 is Easier than Ever!


Guest post from Eun-Kyung and Kizito – Ed.


Qt developers and BlackBerry® 10 developers often ask the following questions:

What is the relationship between Cascades™ and Qt, and how do they interact with each other?

Cascades and Qt frameworks are two major frameworks available in BlackBerry 10 application development. From a high-level architectural point of view, you can say that Cascades sits on top of Qt modules as it is built, using the Qt application framework leveraging Qt object model, event model and threading model. This also uses QtCore, QtXML, QtSql, QtNetwork and QDeclarativeEngine for QML components. Both frameworks use standard C++, signals and slots in Qt for inter-object communication. However, Cascades uses own UI rendering engine and does NOT use any QtGui functionality, while Qt uses raster and the OpenGL graphics engine.

BlackBerry 10 supports BOTH Cascades and Qt

The key point here is that BlackBerry 10 supports BOTH Cascades and Qt frameworks. If you have developed an application using Qt framework for other platforms, you can deploy and run the application on BlackBerry 10 with the minimum effort of fixing a few compile and runtime issues. The downside of this approach is that your application may not have consistent look and feel with the BlackBerry 10 platform, nor have the best integration with the platform itself.

Cascades includes a set of core UI components and platform APIs to create interactive applications accessing the underlying features of the BlackBerry 10 platform. Cascades UI components are designed to have a consistent look and feel, and are optimized for BlackBerry 10 integration such as touch screen interactions. You can use Cascades Builder, the main development tool, for creating BlackBerry Native applications, which is built into the QNX Momentics IDE. The UI preview and the components view are specific features of Cascades Builder when editing QML. Cascades Builder is also integrated to access the BlackBerry platform features and services like audio/video, camera, Ad Service, app integration, BBM™ Social Platform, external data storage access, file system access, internationalization, location, payment service, PIM (Personal Information Management), push services, networking, notifications and sensors. To learn more about the Cascades framework, see Introduction to Cascades.

When porting a Qt application to BlackBerry 10, you can access the same subset of Qt APIs directly without using wrappers for BlackBerry 10. This is powerful and convenient for Qt developers and Qt applications. If you have any Qt applications using Qt APIs such as QGeoCoordinate or QSensor, the same APIs are available and accessible on BlackBerry 10. Currently, the subset of QtCore, QtNetwork, QtLocation, QtSensors, QtSql and QtXML modules are supported. You can check out our sample applications to learn more about these APIs.

Which Framework to Choose to Port your Qt Application?

We recommend that you choose Cascades framework if you are developing a native look-and-feel application on BlackBerry 10 and want to maximize the platform integration. If you are planning to develop an application with specific and customized GUIs, you can choose Qt framework. The decision has to be made before you start writing your application, however, since you can’t mix the UI components between Cascades and Qt. We will walk you through the porting tips based on the framework in the following section.

Basic Step-by-Step for porting a Qt application to BlackBerry 10

1. Set up the tool chains:

  • Download BlackBerry 10 SDK/NDK and Set up
  • If you choose to use Qt Creator, download and configure Qt Creator 2.6 for BlackBerry 10 development. This version is recommended since it has the full support for BlackBerry 10 development including BlackBerry® PlayBook™ tablet and QNX. In order to deploy an existing Qt application project in Qt Creator, you need to add the kit which you defined for BlackBerry 10 to your project. Read the configuration instructions.

2. Build the application. You will have to fix some make, compile, and linking issues.
3. Set up Package and Deployment by adding the application icon and/or splash screen.
4. Fix look and feel issues by adjusting resolutions, icons, windows or font sizes. You can use Cascades components, make your own customized QML components, or use Qt Quick or QWidgets.
5. Address platform specific runtime issues. If necessary, add BlackBerry Platform Services. Often, different platforms handle inputs differently. Test rotating and adjust orientation issues.
6. Add unique features to the BlackBerry 10 platform to add competiveness. You can apply device integrations like QtMobility Sensors, Native BlackBerry Platform Services and PPS APIs.
7. Submit to the BlackBerry App World™ storefront.
8. Start collecting your money!

If you’d like to learn more about porting Qt applications to BlackBerry 10, stay tuned. We are planning to dig deeper into this topic over the next blog post series.

Here are some Cascades, Qt and open-source related links:

Related Posts:

YouTube: BlackBerry Jam Session (JAM12): Porting Qt Applications to BlackBerry 10
Developing in Cascades
What’s up with Qt and the future of Cascades?

Join the conversation

Show comments Hide comments
+ -