Troubleshooting QML Preview

The following information is designed to help you make the most of QML Preview, and troubleshoot any issues you may run into as you use the tool.

For more information about QML Preview, see The QML Editing perspective.

Prerequisites in Windows and Mac OS

To use QML Preview in the Momentics IDE for BlackBerry, you need to have the following:

  • A graphics card with OpenGL 2.0 support
  • The latest drivers for your graphics card

Prerequisites in Linux

As of the 10.2 API level, QML Preview is supported when running certain versions of Ubuntu.

If you use API levels prior to 10.2 in Linux, QML Preview might not function correctly.

Using Ubuntu 12.04

To use QML Preview with Ubuntu 12.04, you must have the libosmesa6 library installed (version 8.0.4-0ubuntu0.5).

For 32-bit systems, you can install the library with:

sudo apt-get install libosmesa6

For 64-bit systems, you can install the library with the following commands:

sudo apt-get install ia32-libs
sudo apt-get install libosmesa6:i386

Using Ubuntu 13.04

To use QML Preview with Ubuntu 13.04, you must have the libosmesa6 library installed (version 8.0.4-0ubuntu0.5).

For 32-bit systems, you can install the library with:

sudo apt-get install libosmesa6

For 64-bit systems, you can install the library with the following commands:

sudo apt-get install ia32-libs
sudo apt-get install libosmesa6:i386

In addition, you need to perform the following:

  1. Navigate to your Native SDK installation directory and rename qmlpreview to qmlpreview.bin:
    cd <BBNDK_INSTALL_DIR>/target_*/linux/x86/usr/bin
    mv qmlpreview qmlpreview.bin
  2. Create a shell wrapper with the following content and save it as qmlpreview:
    #!/bin/sh
    # qmlpreview wrapper file content
    DIR=`dirname $(readlink -f $0)`
    LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1 $DIR/qmlpreview.bin $*
  3. Add an execute permission for the file:
    chmod +x ./qmlpreview

Known limitations of QML Preview

There are several limitations to keep in mind as you work with QML Preview in the Momentics IDE.

Using outdated graphics drivers

Outdated graphics drivers can cause unexpected behavior with QML Preview, including issues with rendering or the inability to use QML Preview. Ensure you are using the latest drivers available for your graphics card before you use QML Preview.

Using QML Preview in a virtual environment

If you run the Momentics IDE in a virtual environment, you need to enable 3-D support in your virtual environment to use QML Preview. For more information on enabling 3-D support, consult the documentation for your virtual environment. For example, if you are using VMware Workstation, see http://www.vmware.com/support/ws5/doc/ws_vidsound_d3d_enabling_vm.html.

If you use a remote desktop tool to run the Momentics IDE, you will not be able to use QML Preview.

Using QML with C++ objects

When you use API levels prior to 10.2, QML Preview can't display QML files that contain components defined in C++ or imported from libraries other than bb.cascades 1.0. Included in the 10.2 version of the Native SDK is the Preprocess QML Files for QML Preview feature. When this feature is enabled, QML Preview attempts to ignore the unsupported components and render the remaining QML components. A 'missing component' placeholder may be displayed in place of the unsupported components. For the most accurate view of your QML content, you should deploy your app to a BlackBerry 10 device or the BlackBerry 10 Device Simulator.

Some components can't be rendered using QML Preview

Some components, such as the WebView control, can't be rendered in QML Preview. For the most accurate view of your QML content, you should deploy your app to a BlackBerry 10 device or the BlackBerry 10 Device Simulator.

For more information on the known limitations, see the Release Notes.

QML Preview FAQ

The following list provides answers to frequently asked troubleshooting questions about QML Preview.

QML Preview has been updated so that each preview runs in a separate, standalone process. This improves the performance and stability of QML Preview. If you are previewing multiple QML files at one time, you may see multiple instances of the qmlpreview process.

If you get an error when using QML Preview, report the error using the Developer Issue Tracker and provide your workspace log and the QML file that triggers the error. You can find the workspace log in the <path to workspace>/.metadata folder.

Previously, QML Preview would fail to load if your QML included objects that QML Preview couldn't render (such as C++ objects registered in QML). Included in the 10.2 version of the Native SDK is the Preprocess QML Files for QML Preview feature that filters items that can't be rendered, and displays the parts of the UI that can be shown. The preprocessing feature is enabled by default, but you can disable it if needed. To disable the feature, click Window > Preferences > BlackBerry > QML Editor and clear the Preprocess QML Files for QML Preview check box.

If you see the "Loading dynamic content of <file>" timeout message, close and reopen the QML file and try again. If the problem persists, report the error using the Developer Issue Tracker and provide your workspace log and the QML file that triggers the error. You can find the workspace log in the <path to workspace>/.metadata folder.

While QML Preview uses the same rendering engine as a device, there are several reasons why the preview doesn't match the UI, such as:

  • QML Preview only renders from the current file, and may exclude components or features that are defined elsewhere in the app.
  • C++ components can't be rendered using QML Preview.
  • External assets that are located outside the assets folder of the project can't be previewed.
  • The current file attempts to use a resolution, theme, or orientation that is not supported by the device.

If you get this error and clicking the 'Try again' button doesn't resolve the issue, make sure your system meets the requirements listed above. If the problem persists, report the error using the Developer Issue Tracker and provide your workspace log and the QML file that triggers the error. You can find the workspace log in the <path to workspace>/.metadata folder.

QML Preview can only render QML objects from the bb.cascades library imported to your project. If you import the bb.cascades 1.2 library but your API level is set to 10.1 or older, QML Preview can't render the file.

Workaround: Update your API level to 10.2, or change the imported library to match your selected API level. To change your API level, click Window > Preferences > BlackBerry > API Level and select the API level from the drop-down list.

To enable QML Preview, click Window > Preferences > BlackBerry > QML Editor and clear the Disable QML Preview check box.

For more help

For more help, check out the Cascades Development support forums.

Last modified: 2014-01-23

comments powered by Disqus