Platform and Compiler Notes - BlackBerry

This page lists features and restrictions that are particular for Qt on BlackBerry 10.

Supported Modules

Most Qt modules (essential and add-on) are supported except for instance Qt WebKit and platform-specific ones. BlackBerry supported modules shows a detailed list of what is supported and what isn't.

Application Window

The first top-level window that is shown will always be full screen. This parent-less window serves as the application window, all other windows descend from it, even if they don't have a parent from Qt's perspective. It is not possible to re-parent this window to another window and when it is deleted any other window will vanish, as well.

In general, it is not possible to promote child windows to top level windows (setParent() with an argument of 0). If you do so, the window will vanish along with its child windows.

Working Directory

Applications are restricted to their working directory (aka sandbox), they cannot read or write outside this directory. Nevertheless absolute file paths are visible, for instance calling QDir::currentPath() will initially yield /accounts/1000/appdata/namespace.application/. This is the root directory an application is confined to. A more detaild overview how to work with the file system can be found in the corresponding BlackBerry 10 documentation.

Application Lifecycle

A detailed overview of the states an application can move through can be found here. Most of the transitions are mapped to Qt signals and events. For instance, if the application is minimized a QGuiApplication::applicationStateChanged signal is emitted with an argument of Qt::ApplicationInactive and a QExposeEvent is sent to the application window. In the cases where this is not sufficient, a native event filter can be use, that listens for navigator events. The navigator on the BlackBerry 10 OS handles the entire application window lifecycle.

Peculiarities

This is a list of topics specific to Blackberry 10 which are discussed in their own sections:

  • Native events
  • QSettings
  • Cover windows

Multimedia

Restrictions that apply to Qt Multimedia on BlackBerry are described here.

Sensors

Most sensors are supported on BlackBerry (such as accelerometer, compass, magnetometer, gyroscope, (IR) proximity, (ambient) light, orientation, rotation and holster sensors). However, different devices might support a different set of sensors. QSensor::sensorTypes() will return a list of sensors that are supported on a particular device.

Relationship to Cascades

Cascades is the prevailing UI framework for BlackBerry 10 development. It uses Qt (4.8) C++ and QML as a base to provide a standard set of UI controls and other APIs tailored to the BlackBerry 10 platform. If you are curious, take a look at the Introduction to Cascades article. Note that Cascades uses its own backend to render on the screen and uses only non-UI parts of Qt. It is not possible to mix Qt and Cascades APIs to access the screen in one application.

Qt Widgets Style

If the UI of your application is based on Qt Widgets, you should consider using the BlackBerry 10 specific Qt widget style. This style matches the system-wide UI appearance and improves usability. The BlackBerry 10 style is implemented as proxy style in C++ and is loaded as a style plug-in on demand. The style is available only on Qt builds for BlackBerry 10 and is not available in builds for other platforms.

There are two variants of the style fitting the dark and bright themes on the BlackBerry 10.1.x and 10.2.x releases:

Style key bb10brightStyle key bb10dark

[Missing image bb10bright-style.png]

[Missing image bb10dark-style.png]

You can activate one of the styles with QApplication::setStyle(), e.g.

QApplication::setStyle(QStringLiteral("bb10dark"));

The BlackBerry 10 style only covers those Qt Widgets which fit well on small screens and can be controlled with touch input in a comfortable way:

  • QCheckBox
  • QComboBox
  • QLineEdit
  • QPushButton
  • QProgressBar
  • QRadioButton
  • QSlider
  • QScrollBar
  • QTextEdit
  • item view widgets

Consider using Qt Quick for more complex UIs.

References