Commit a7ac2bb5 authored by Tobias Nätterlund's avatar Tobias Nätterlund Committed by Daniel Teske

New QNX plugin.

This plugin adds support for cross-compiling, deploying, running
and debugging on a PlayBook or QNX Neutrino device.

Change-Id: I0da7ccee40bd7ce4c0d6bdc6884d48ef23167dac
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent cbce4389
......@@ -29,7 +29,7 @@
\contentspage index.html
\previouspage creator-deployment-symbian.html
\page creator-deployment-maemo.html
\nextpage creator-connecting-mobile.html
\nextpage creator-deployment-qnx.html
\title Deploying Applications to Linux-Based Devices
......
......@@ -55,6 +55,11 @@
can test and debug the application on the device.
You can create Debian installation packages for MeeGo Harmattan and
Maemo 5 devices.
\o \l{Deploying Applications to QNX Devices}
When you deploy the application on the \gui{QNX} target, \QC generates
a BAR package in the build directory and deploys it to the connected
device. You can test and debug the application on the device.
\endlist
\section1 Related Topics
......
......@@ -27,7 +27,7 @@
/*!
\contentspage index.html
\previouspage creator-deployment-maemo.html
\previouspage creator-deployment-qnx.html
\page creator-connecting-mobile.html
\nextpage creator-developing-meego.html
......@@ -76,6 +76,13 @@
Install and launch the CODA on-device debugging agent on the
devices and connect the devices to the development PC.
\o \l{Connecting QNX Devices}
You can connect QNX devices to the development PC to deploy, run and
debug applications on them from within \QC. This is currently only
supported for BlackBerry Playbook, and requires the BlackBerry NDK
to be installed on the development PC.
\endlist
*/
......@@ -16,6 +16,8 @@
\o Symbian
\o QNX
\endlist
The following table summarizes operating system support for developing
......@@ -23,8 +25,8 @@
\table
\header
\o {1,6} Operating system
\o {6,1} Platform
\o {1,7} Operating system
\o {7,1} Platform
\header
\o Desktop
\o \QS
......@@ -32,6 +34,7 @@
\o MeeGo Harmattan
\o Generic Remote Linux
\o Symbian
\o QNX
\row
\o Windows
......@@ -41,6 +44,7 @@
\o Yes
\o Yes
\o Yes
\o Yes (see \l{Running on QNX Devices} for limitations)
\row
\o Linux
\o Yes
......@@ -49,6 +53,7 @@
\o Yes
\o Yes
\o Yes (by using Remote Compiler for building)
\o Yes
\row
\o Mac OS X
\o Yes
......@@ -57,4 +62,5 @@
\o Yes
\o Yes
\o Yes (by using Remote Compiler for building)
\o Yes
\endtable
......@@ -27,7 +27,7 @@
/*!
\contentspage index.html
\previouspage creator-developing-symbian.html
\previouspage creator-developing-qnx.html
\page creator-build-process-customizing.html
\nextpage creator-maemo-emulator.html
......
......@@ -83,6 +83,7 @@
\if defined(qcmanual)
\input symbian/creator-projects-qt-versions-symbian.qdocinc
\input qnx/creator-projects-qt-version-qnx.qdocinc
\endif
*/
......
......@@ -55,6 +55,7 @@
\input linux-mobile/creator-projects-running-madde.qdocinc
\input linux-mobile/creator-projects-running-generic-linux.qdocinc
\input symbian/creator-projects-running-symbian.qdocinc
\input qnx/creator-projects-running-qnx.qdocinc
\endif
*/
......@@ -54,6 +54,7 @@
\input projects/creator-projects-settings-run-debug.qdocinc
\input symbian/creator-projects-settings-run-symbian.qdocinc
\input linux-mobile/creator-projects-settings-run-linux.qdocinc
\input qnx/creator-projects-settings-run-qnx.qdocinc
\endif
\section1 Specifying a Custom Executable to Run
......
/****************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (C) 2011 - 2012 Research In Motion
**
** Contact: Research In Motion (blackberry-qt@qnx.com)
** Contact: KDAB (info@kdab.com)
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
/*!
\contentspage index.html
\previouspage creator-deployment-maemo.html
\page creator-deployment-qnx.html
\nextpage creator-connecting-mobile.html
\title Deploying Applications to QNX Devices
When you deploy the application on the \gui{QNX} target, \QC generates
a BAR package in the build directory and installs it on the connected
device. The contents of the BAR package are specified in the \gui{Application
Descriptor File}.
\image qtcreator-qnx-deployment.png "Deploy to device"
The name of the generated BAR package is shown in the \gui{Bar package}
setting. If the package already exists, it will be overwritten without
prior notification.
\section1 Application Descriptor File
The application descriptor file needs to be created manually,
or you can use the \gui{Application Descriptor} wizard to have a generic
template generated. The wizard is available in \gui {File > New File or
Project > BlackBerry > Application descriptor}. This wizard will also
include a splashscreen.png and an icon.png file which are included in the
application descriptor file.
To tailor your BAR packages, you will have to manually edit the application
descriptor file. For a full reference, see
\l{https://bdsc.webapps.blackberry.com/native/documentation/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/r_blackberry_tablet_dtd_intro.html}
{Document Type Definition (DTD) for the application descriptor file}.
*/
/****************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (C) 2011 - 2012 Research In Motion
**
** Contact: Research In Motion (blackberry-qt@qnx.com)
** Contact: KDAB (info@kdab.com)
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
****************************************************************************/
/*!
\contentspage index.html
\previouspage creator-developing-symbian.html
\page creator-developing-qnx.html
\nextpage creator-build-process-customizing.html
\title Connecting QNX Devices
You can connect QNX devices to the development PC to deploy, run and debug
applications on them from within \QC.
\section1 Setting Up Connectivity on Playbook
In order to deploy applications to the Playbook, you will need to enable
Development Mode on the device and upload a debug token to it.
Enabling Development Mode is done by sliding top-down on the Playbook,
thereby opening the \gui{Preferences}. Now go to \gui{Security >
Development Mode} and set \gui{Use Development Mode} to \gui{ON}. Enter the
device password when asked to do so.
\image qtcreator-qnx-playbook-development-mode.png
\section2 USB Access
The \gui{Development Address} shown in the \gui{Development Mode} settings
is the IP address to use when you are connecting the device with a USB
cable to the development PC. If you are deploying over a Wi-Fi network, you
should use the IP address shown in \gui{Preferences > About > Network}.
To enable access over USB, change \gui{Preferences > Storage & Sharing >
USB Connections} to \gui{Connect to Windows} if you are deploying from
Windows, or \gui{Connect to Mac} if you are deploying from Linux or Mac OS.
\image qtcreator-qnx-playbook-storage-sharing.png
\section2 Debug Token
If you are using a physical device, you will have to upload a debug token to
the device. The simulator does not require any debug token.
\section3 Create a Debug Token
You can create the debug token either in QNX Momentics or from the command
line. There is currently no support for creating the debug token from
within \QC.
From the command line:
\c{blackberry-debugtokenrequest -storepass <pass> -devicepin <your PB pin> debugtoken.bar}
\section3 Install Debug Token on Playbook
You can install the debug token on the Playbook either in QNX Momentics or
from the command line. There is currently no support for installing the
debug token from within \QC.
From the command line:
\c{blackberry-nativepackage -installDebugToken ~/.rim/debugtoken.bar -device <device_ip> [-password <device_pass>]}
\section1 Adding a QNX Device in \QC
Adding a QNX device is done using a wizard in the \gui{Device
Configurations} options. To launch it, go to \gui{Tools > Options >
Linux Devices > Device Configurations > Add... > QNX device > Start
Wizard}.
\image qtcreator-qnx-device-configurations-wizard-1.png "Connection details"
\list
\o In the \gui{The name to identify this configuration} field, enter a
name for the device.
\o In the \gui{The device's host name or IP address} field, enter the
host name or IP address of the device.
\o In the \gui{Device password} field, enter the password for the device.
\o In the \gui{Device type} field, select whether it is a \gui{Physical
device} or a \gui{Simulator} you are connecting to.
\o In the \gui{Debug token} field, enter the path to the debug token
that is also installed on the device. This is only necessary if you are
connecting to a \gui{Physical device}.
\o Click \gui{Next} to continue.
\endlist
\image qtcreator-qnx-device-configurations-wizard-2.png "SSH Key Setup"
For the \gui{SSH Key Setup}, you can either select an existing \bold{4096}-bit
key, or click \gui{Generate} to create a new key. The generated key will be
stored next to the \QC settings, in a \bold{qnx} sub-directory.
Click \gui{Next} and then \gui{Finish} to complete setting up the device
connection.
Once the device is added, you can edit the settings directly in the
\gui{Device Configurations} options page.
\image qtcreator-qnx-device-configurations.png "Device Configurations"
*/
\section2 Setting Up Qt for QNX Versions
If you install Qt for QNX as a part of Qt Playbook SDK, it is automatically
detected by \QC. The \gui {BlackBerry Native SDK} field displays the path to the directory where
the Blackberry NDK is located.
To view Qt for QNX version settings, select \gui {Tools > Options >
Build & Run > Qt Versions}.
\image qtcreator-qt4-qtversions-win-qnx.png
If you have built your own version of Qt for QNX you need to add this manually to Qt Creator
using the above dialog:
\list
\o Select \gui {Tools > Options > Build & Run > Qt Versions > Add}.
\o Navigate to and select the qmake application that is part of your Qt for QNX build and select
\gui {Open}.
\o In the \gui {Blackberry Native SDK} field enter the path to your installed Blackberry NDK.
\o Select \gui {OK}.
\endlist
\section1 Running on QNX Devices
\list 1
\o Connect the device to the development PC or to the Wi-Fi network.
\o Configure the device and specify a connection to it. For more
information, see \l{Connecting QNX Devices}.
\o Create an Application Descriptor File if it does not already exist.
For more information, see \l{Deploying Applications to QNX
Devices}.
\o Click the \gui Run button.
\endlist
\QC uses the compiler specified in the QNX tool chain to build the
application.
\QC generates a BAR package, installs it on the device, and
executes the selected application. The application views are displayed on
the device. Command-line output is visible in the \QC
\gui {Application Output} view.
\note Debugging is currently only fully supported on Linux and Mac OS.
It is not possible to insert breakpoints during runtime on Windows.
\section2 Troubleshooting Errors
For the command-line output to show up in the \gui{Application Output}
view, \QC needs to be able to establish an SSH connection to the device.
This is only possible if QNX Momentics is not running, and the SSH key
configured for the device is a 4096-bit key.
If these conditions are not met, you will get an error message saying debug
output cannot be shown.
\ No newline at end of file
\section2 Specifying Run Settings for QNX Devices
To run and debug an application on a QNX device, you must create connections
from the development PC to the device. Click \gui {Manage device configurations}
to create a connection. For more information, see \l{Connecting QNX
Devices}.
\image qtcreator-qnx-run-settings.png "Run settings for QNX devices"
When you run the application on the QNX device, \QC first creates a BAR package
using the settings in the Application Descriptor File. The default is to create the
BAR package in the build directory. The BAR package is then deployed onto the
selected device. For more information, see \l{Deploying Applications to QNX Devices}.
......@@ -240,6 +240,7 @@
\list
\o \l{Deploying Applications to Symbian Devices}
\o \l{Deploying Applications to Linux-Based Devices}
\o \l{Deploying Applications to QNX Devices}
\endlist
\o \l{Connecting Mobile Targets}
\list
......@@ -247,6 +248,7 @@
\o \l{Connecting Embedded Linux Devices}
\o \l{Connecting Maemo Devices}
\o \l{Connecting Symbian Devices}
\o \l{Connecting QNX Devices}
\endlist
\o \l{Customizing the Build Process}
\o \l{Using Maemo or MeeGo Harmattan Emulator}
......
......@@ -28,7 +28,7 @@
\endif
\page creator-developing-symbian.html
\if defined(qcmanual)
\nextpage creator-build-process-customizing.html
\nextpage creator-developing-qnx.html
\else
\nextpage creator-developing-meego.html
\endif
......
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
<id>ID</id>
<name>PROJECTNAME</name>
<versionNumber>1.0.0</versionNumber>
<description>DESCRIPTION</description>
<initialWindow>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
<autoOrients>true</autoOrients>
<aspectRatio>landscape</aspectRatio>
</initialWindow>
<publisher>PUBLISHER</publisher>
<copyright>COPYRIGHT</copyright>
<env var="QML_IMPORT_PATH" value="app/native/imports"/>
<env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
<arg>-platform</arg>
<arg>blackberry</arg>
<arg>-style</arg>
<arg>qnxlight</arg>
<action system="true">run_native</action>
<!-- PROJECTPATH should point to the project binary, path can be relative -->
<asset entry="true" path="PROJECTPATH" type="Qnx/Elf">PROJECTNAME</asset>
<!-- These values will be replaced when deploying in Qt Creator -->
<asset path="%QT_INSTALL_LIBS%">lib</asset>
<asset path="%QT_INSTALL_PLUGINS%">plugins</asset>
<asset path="%QT_INSTALL_IMPORTS%">imports</asset>
</qnx>
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
-->
<wizard version="1" kind="file" id="Q.QnxBlackBerryBarDescriptor" category="Q.BlackBerry"
featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
<description>Creates an application descriptor file.</description>
<displayname>Application descriptor</displayname>;
<displaycategory>BlackBerry</displaycategory>
<files>
<file source="bar-descriptor.xml" openeditor="true"/>
</files>
</wizard>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
<id>ID</id>
<name>%ProjectName%</name>
<versionNumber>1.0.0</versionNumber>
<description>DESCRIPTION</description>
<initialWindow>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
<autoOrients>true</autoOrients>
<aspectRatio>landscape</aspectRatio>
</initialWindow>
<env var="QML_IMPORT_PATH" value="app/native/imports"/>
<env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
<arg>-platform</arg>
<arg>blackberry</arg>
<action system="true">run_native</action>
<asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
<!-- These values will be replaced when deploying in Qt Creator -->
<asset path="%QT_INSTALL_LIBS%">lib</asset>
<asset path="%QT_INSTALL_PLUGINS%">plugins</asset>
<asset path="%QT_INSTALL_IMPORTS%">imports</asset>
</qnx>
#include <QApplication>
#include "mainwidget.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWidget w;
w.showMaximized();
return a.exec();
}
#include "mainwidget.h"
#include "ui_mainwidget.h"
MainWidget::MainWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::MainWidget)
{
ui->setupUi(this);
}
MainWidget::~MainWidget()
{
delete ui;
}
#ifndef MAINWIDGET_H
#define MAINWIDGET_H
#include <QWidget>
namespace Ui {
class MainWidget;
}
class MainWidget : public QWidget