×
Namespaces

Variants
Actions
(Difference between revisions)

Using Qt Creator with Symbian

From Nokia Developer Wiki
Jump to: navigation, search
ceefour (Talk | contribs)
(Create Mobile Qt project with Qt Creator - Creating a Mobile Qt Application)
hamishwillee (Talk | contribs)
m (Hamishwillee - Remove remote compiler sections as this has been discontinued)
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Qt]][[Category:Qt for Symbian]][[Category:Qt Mobility]][[Category:Series 40]][[Category:Symbian]][[Category:Symbian C++]]
+
[[Category:Qt]][[Category:Qt Mobility]][[Category:Symbian]][[Category:Qt Creator]]
=Overview=
+
{{Abstract|This article explains how to use the '''Qt Creator''' with  '''Nokia Qt SDK''' to write and test applications for Symbian Devices.}}
  
{{NeedsMoreWork}}
+
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= <!-- Devices tested against - e.g. ''devices=N95, N8'') -->
 +
|sdk= Nokia Qt SDK 1.0
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 18 March 2010
 +
|author= [[User:gaba88]]
 +
<!-- The following are not in current metadata -->
 +
|timestamp= <!-- Following technical re-review of article: YYYYMMDD -->
 +
|reviewer= <!-- Following technical re-review of article: [[User:username]] -->
 +
}}
  
This article contains out-dated information. With current Nokia Qt Creator the process is highly simplified.
+
{{ArticleNeedsUpdate|timestamp=20110825070029|user=[[User:Hamishwillee|&lt;br /&gt;----]]|These instructions are against an old version of Qt "The Nokia Qt SDK 1.0". It needs a review agaisnt the "Qt SDK 1.1.4" (five new versions on). It also appears to assume you're managing multiple SDKs or possibly using Qt creator over the top of a Symbian SDK. That is no longer enabled.}}
 +
== Preparing Your Development Environment ==
  
This article will explain, how the developer can use Qt Creator to write and test applications for Symbian SDKs and Devices.
+
Install the [http://www.developer.nokia.com/info/sw.nokia.com/id/e920da1a-5b18-42df-82c3-907413e525fb/Nokia_Qt_SDK.html Nokia Qt SDK], which contains Qt SDK, Qt Mobility SDK ([http://doc.qt.nokia.com/qtmobility-1.2/ Qt Mobility API]), Qt Creator, Qt Simulator for Symbian and N900, and libraries, tools (including the emulator for S60 environment), and all documentation you need to get started.
 
+
=Preparing Your Development Environment=
+
 
+
Install the [http://www.forum.nokia.com/info/sw.nokia.com/id/e920da1a-5b18-42df-82c3-907413e525fb/Nokia_Qt_SDK.html Nokia Qt SDK], which contains Qt SDK, Qt Mobility SDK, Qt Creator, Qt Simulator for Symbian and N900, and libraries, tools (including the emulator for S60 environment), and all documentation you need to get started.
+
  
 
Qt Creator is an IDE built on Qt itself, and contains an easy-to-use visual designer for designing your application UI.
 
Qt Creator is an IDE built on Qt itself, and contains an easy-to-use visual designer for designing your application UI.
Line 16: Line 37:
 
You can also download the individual components:
 
You can also download the individual components:
  
# Set up the S60 development Environment. First install [http://www.activestate.com/activeperl Active Perl] and then [http://www.forum.nokia.com/info/sw.nokia.com/id/ec866fab-4b76-49f6-b5a5-af0631419e9c/S60_All_in_One_SDKs.html S60 Platform and Device SDKs for Symbian OS].
+
# Set up the S60 development Environment. First install [http://www.activestate.com/activeperl Active Perl] and then [http://www.developer.nokia.com/info/sw.nokia.com/id/ec866fab-4b76-49f6-b5a5-af0631419e9c/S60_All_in_One_SDKs.html S60 Platform and Device SDKs for Symbian OS].
# Install the relevant [http://qt.nokia.com/downloads Qt for Symbian SDK].
+
# Install the relevant [http://qt.nokia.com/downloads Qt SDK].
 
# Install [http://qt.nokia.com/downloads/qt-creator-binary-for-windows Qt Creator binary for Windows].
 
# Install [http://qt.nokia.com/downloads/qt-creator-binary-for-windows Qt Creator binary for Windows].
  
 
Note: When installing Qt Creator, make sure to install Qt Creator on same drive where you have installed all S60 SDKs.
 
Note: When installing Qt Creator, make sure to install Qt Creator on same drive where you have installed all S60 SDKs.
 
   
 
   
=Choosing the Default Qt SDK=
+
== Creating a Mobile Qt Application ==
  
After following the steps above, I assume that the developer has properly installed the S60 SDKs and Qt for Symbian SDK.
+
Creating a new mobile application utilizing Qt and Qt Mobility APIs is very easy and straightforward with the latest version of Qt Creator (included as part of [http://www.developer.nokia.com/info/sw.nokia.com/id/e920da1a-5b18-42df-82c3-907413e525fb/Nokia_Qt_SDK.html Nokia Qt SDK]).
  
Qt Creator should automatically detect Qt SDKs that have been configured for use with Qt.
+
# Click '''Create Project''' and choose '''Mobile Qt''' project.
 +
#: [[File:Qt-creator-new-mobile-qt-project-1.png|thumb|none|500px]]
 +
# '''Name your project''' and choose destination directory.
 +
#: [[File:Qt-creator-new-mobile-qt-project-2.png|thumb|none|500px]]
 +
# '''Choose your target platforms.''' Maemo and Qt Simulator should be pre-selected. You can also choose Symbian/S60 if you have configured them.
 +
#: [[File:Qt-creator-new-mobile-qt-project-3.png|thumb|none|500px]]
 +
# Edit the main class names or simply accept the defaults.
 +
#: [[File:Qt-creator-new-mobile-qt-project-4.png|thumb|none|500px]]
 +
# Finish the wizard to create the project.
 +
#: [[File:Qt-creator-new-mobile-qt-project-5.png|thumb|none|500px]]
  
Since there may be several Qt SDKs installed in your system, ensure that the correct SDK is used as the Qt build target: 
+
Qt Creator will create your project, ''already set up to use Qt Mobility APIs, and with build targets properly configured'' for Symbian, Qt Simulator, and Maemo (depending on your previous choices).
  
# Start Qt Creator from Windows Start button > All Programs > Nokia Qt SDK > Qt Creator.
+
You can use the built-in Form Designer in Qt Creator to '''easily design your application's user interface.'''
# In Qt Creator Menu bar, click Tools > Options > Qt SDK versions. Now you can set your default Qt SDK version.
+
# Select the you required SDK in Default Qt version field, in our case it will be ''S60 5th edition Qt 4.6.2''.
+
  
The Screenshot shown below helps in better understanding:  
+
[[File:Qt-creator-new-mobile-qt-project-6.png|thumb|none|500px]]
  
[[File:QtCreator_Symbian1.jpg]]
+
You can '''easily switch among the configured build configurations.''' Developing cross-platform applications has never been this easy!
  
=Creating a Mobile Qt Application=
+
[[File:Qt-creator-new-mobile-qt-project-7.png|thumb|none|500px]]
  
Creating a new mobile application utilizing Qt and Qt Mobility APIs is very easy and straightforward with the latest version of Qt Creator (included as part of [http://www.forum.nokia.com/info/sw.nokia.com/id/e920da1a-5b18-42df-82c3-907413e525fb/Nokia_Qt_SDK.html Nokia Qt SDK]).
+
Switch to '''Projects mode''' (Ctrl+5) to edit build and run settings for your application. You can also add a new build setting for another target platform.
  
1. Click '''Create Project''' and choose '''Mobile Qt''' project.
+
[[File:Qt-creator-new-mobile-qt-project-8.png|thumb|none|500px]]
  
[[Image:Qt-creator-new-mobile-qt-project-1.png|thumb|none|400px]]
+
Finally, you can run and test your application. To run the application in Qt Simulator, '''make sure Qt Simulator is selected in build/run settings''', then click the '''Run button''' or press Ctrl+R.  
  
2. Name your project and choose destination directory.
+
[[File:Qt-creator-new-mobile-qt-project-9.png]]
  
[[Image:Qt-creator-new-mobile-qt-project-2.png|thumb|none|400px]]
+
You can interact with the application as you would in a device. You can also change device settings, rotation, simulated device, etc. in Qt Simulator panel.
  
=Running the Application in S60 SDK=
+
== Building Applications for Symbian Devices ==
  
* Make any simple project in Qt, if you have an windows SDK installed then do check that the application works fine with windows.
+
The Windows version of Nokia Qt SDK already includes the Symbian compiler that you can use to build applications for Symbian devices.
  
* Select the Projects icon in the Qt creator sidebar.
+
After developing your Qt application (see steps above), switch to '''Projects mode''' (Ctrl+5) and choose '''Symbian Device''' build target. If the project doesn't have the Symbian Device build target, click the "+" button to add a new target and choose "Symbian Device" (note that you must have properly configured Symbian SDK and Qt SDK).
  
* In the "Build Settings" section select the Debug option, then press Add  Selected to copy the current debug configuration. Give the configuration some meaningful name. The screen shot below gives a better understanding.
+
[[File:Qt-creator-symbian-device.png|thumb|none|500px]]
  
 +
The Debug build configuration uses WINSCW compiler, for running applications inside the Symbian S60 Emulator. The Release build configuration uses the GCCE compiler, so you can package applications as SIS files and run/deploy applications to Symbian devices.
  
[[File:QtCreator_Symbian5.jpg]]
+
Now you can run and test your application using Symbian Emulator or a Nokia phone.
  
  
* Select "Show Details" in the General build settings, then change the Tool Chain from '''GCCE''' to '''WINSCW'''.
+
== Packaging Application as SIS File and Deploying to Symbian Device ==
  
 +
Symbian uses the SIS Package format for application installation. Qt Creator provides built-in functionality to create SIS packages:
  
[[File:QtCreator_Symbian3.jpg]]
+
# Switch to '''Projects mode''' (Ctrl+5) in the Qt Creator sidebar.
 +
# Click '''Symbian Device > Build''', select the '''Release''' option. Note: If your project doesn't have a Symbian Device build setting yet, first make sure that you have properly installed Symbian S60 SDK and Qt SDK, then add a new build setting for Symbian Device.
 +
# Select "Show Details" in the General build settings, then change the Tool Chain from '''WINSCW''' to '''GCCE'''.
 +
# Click '''Symbian Device > Run'''. Expand '''Create SIS Package''', and change the settings if needed. The default is to package an unsigned SIS file, but you can sign the SIS file with your own [[Complete Guide To Symbian Signed|Symbian Signed certificate and key file]]. You can also package your Symbian application with [[Nokia Smart Installer for Symbian|Nokia Smart Installer]] (which is required for publishing mobile applications to [http://store.ovi.com/ Nokia Store] using [https://publish.ovi.com/login Ovi Publish]).
 +
# Build or Run the application.
  
 +
[[File:Qtcreator-symbian-run-settings.png|thumb|none|500px]]
  
* Set the new build configuration active.
+
=== makesis Command-line Tool ===
  
 +
While Qt Creator is convenient for rapid development, sometimes you want to build the SIS package file from the command line. You can use {{Icode|makesis}} tool from the Symbian SDK for this purpose.
  
* Then the final step is you can build the application and if your build was error free you can open your S60 SDK for which you made the build and check out your application.  
+
Browse to your application directory and locate your pkg file and use the makesis tool. Refer to the image below for illustration.
  
=  Making a Standalone sis to be checked on S60 device=
+
[[File:QtCreator Symbian4.jpg]]
  
* Select the Projects icon in the Qt creator sidebar.  
+
You will get the SIS file in your application directory.
  
* In the "Build Settings" section select the release option.  
+
Now you can install it to your S60 device using [http://www.comms.ovi.com/m/p/ovi/suite/English Ovi Suite] or Bluetooth transfer.
  
* Select "Show Details" in the General build settings, then change the Tool Chain from '''WINSCW''' to '''GCCE'''.
+
== Managing Multiple Qt SDKs ==
  
* start building the application.  
+
Qt Creator can work with multiple Qt SDKs at once, and it should automatically detect Qt SDKs that have been configured for use with Qt Creator.
  
* Qt Creator doesn't have any direct option to make a sis, instead you have to use makesis tool of symbian to make a sis out of the pkg file.  
+
To inspect the configured Qt SDKs or add an additional Qt SDK: Click Tools menu > Options > Qt4 > Qt versions.
  
* So browse to your application directory and locate your pkg file and use the makesis tool, the below image explains the point clearly.  
+
A Qt Creator project is flexible, it can use one or more Qt SDKs. You set the Qt SDK by going to '''Projects mode''' (Ctrl+5) and specifying which Qt SDK version to use for each build '''Target'''. Each target can have a different Qt SDK. For example, to compile for Qt Simulator, the Target should use Qt SDK for Qt Simulator. To build for Symbian device, configure the Target to use the Qt SDK.
  
 +
This flexibility makes it very easy to develop, run, and test Qt applications for multiple target platforms at once.
  
[[File:QtCreator_Symbian4.jpg]]
+
[[File:Qt-creator-qt4-versions.png|thumb|none|500px]]
  
 +
== Conclusion ==
  
* you will get the sis in your application directory and install it in your S60 device.
+
As demonstrated, it is easy for the developer to start developing Symbian Applications using Qt Creator.  
  
=Conclusion=
+
Especially with Qt Mobility APIs and Qt Simulator that is bundled with Nokia Qt SDK, developing Qt applications for Symbian that uses native mobile features are a straightforward process.
  
Executing this steps properly will help the developer to start developing Symbian Applications using the Qt Creator.  
+
Previously, Symbian S60 SDKs were only available for Windows systems. Nokia Qt SDK makes developers lives easier because it is available for all desktop platforms (Windows, Linux, and Mac OS X).  
  
The next step would be to download the new Qt Mobility APIs and start developing using some native mobility functions.[[Category:Qt Creator]]
+
So you can develop Symbian applications using any desktop operating system of your choice. (Some of the screenshots of Qt Creator above are captured while using the Linux-based Ubuntu 10.10 operating system.)

Latest revision as of 06:59, 13 November 2012

This article explains how to use the Qt Creator with Nokia Qt SDK to write and test applications for Symbian Devices.

Article Metadata
Tested with
SDK: Nokia Qt SDK 1.0
Compatibility
Platform(s):
Symbian
Article
Created: gaba88 (18 Mar 2010)
Last edited: hamishwillee (13 Nov 2012)

Needs-update.pngThis article needs to be updated: If you found this article useful, please fix the problems below then delete the {{ArticleNeedsUpdate}} template from the article to remove this warning.

Reasons: hamishwillee (25 Aug 2011)
These instructions are against an old version of Qt "The Nokia Qt SDK 1.0". It needs a review agaisnt the "Qt SDK 1.1.4" (five new versions on). It also appears to assume you're managing multiple SDKs or possibly using Qt creator over the top of a Symbian SDK. That is no longer enabled.

Contents

[edit] Preparing Your Development Environment

Install the Nokia Qt SDK, which contains Qt SDK, Qt Mobility SDK (Qt Mobility API), Qt Creator, Qt Simulator for Symbian and N900, and libraries, tools (including the emulator for S60 environment), and all documentation you need to get started.

Qt Creator is an IDE built on Qt itself, and contains an easy-to-use visual designer for designing your application UI.

You can also download the individual components:

  1. Set up the S60 development Environment. First install Active Perl and then S60 Platform and Device SDKs for Symbian OS.
  2. Install the relevant Qt SDK.
  3. Install Qt Creator binary for Windows.

Note: When installing Qt Creator, make sure to install Qt Creator on same drive where you have installed all S60 SDKs.

[edit] Creating a Mobile Qt Application

Creating a new mobile application utilizing Qt and Qt Mobility APIs is very easy and straightforward with the latest version of Qt Creator (included as part of Nokia Qt SDK).

  1. Click Create Project and choose Mobile Qt project.
    Qt-creator-new-mobile-qt-project-1.png
  2. Name your project and choose destination directory.
    Qt-creator-new-mobile-qt-project-2.png
  3. Choose your target platforms. Maemo and Qt Simulator should be pre-selected. You can also choose Symbian/S60 if you have configured them.
    Qt-creator-new-mobile-qt-project-3.png
  4. Edit the main class names or simply accept the defaults.
    Qt-creator-new-mobile-qt-project-4.png
  5. Finish the wizard to create the project.
    Qt-creator-new-mobile-qt-project-5.png

Qt Creator will create your project, already set up to use Qt Mobility APIs, and with build targets properly configured for Symbian, Qt Simulator, and Maemo (depending on your previous choices).

You can use the built-in Form Designer in Qt Creator to easily design your application's user interface.

Qt-creator-new-mobile-qt-project-6.png

You can easily switch among the configured build configurations. Developing cross-platform applications has never been this easy!

Qt-creator-new-mobile-qt-project-7.png

Switch to Projects mode (Ctrl+5) to edit build and run settings for your application. You can also add a new build setting for another target platform.

Qt-creator-new-mobile-qt-project-8.png

Finally, you can run and test your application. To run the application in Qt Simulator, make sure Qt Simulator is selected in build/run settings, then click the Run button or press Ctrl+R.

Qt-creator-new-mobile-qt-project-9.png

You can interact with the application as you would in a device. You can also change device settings, rotation, simulated device, etc. in Qt Simulator panel.

[edit] Building Applications for Symbian Devices

The Windows version of Nokia Qt SDK already includes the Symbian compiler that you can use to build applications for Symbian devices.

After developing your Qt application (see steps above), switch to Projects mode (Ctrl+5) and choose Symbian Device build target. If the project doesn't have the Symbian Device build target, click the "+" button to add a new target and choose "Symbian Device" (note that you must have properly configured Symbian SDK and Qt SDK).

Qt-creator-symbian-device.png

The Debug build configuration uses WINSCW compiler, for running applications inside the Symbian S60 Emulator. The Release build configuration uses the GCCE compiler, so you can package applications as SIS files and run/deploy applications to Symbian devices.

Now you can run and test your application using Symbian Emulator or a Nokia phone.


[edit] Packaging Application as SIS File and Deploying to Symbian Device

Symbian uses the SIS Package format for application installation. Qt Creator provides built-in functionality to create SIS packages:

  1. Switch to Projects mode (Ctrl+5) in the Qt Creator sidebar.
  2. Click Symbian Device > Build, select the Release option. Note: If your project doesn't have a Symbian Device build setting yet, first make sure that you have properly installed Symbian S60 SDK and Qt SDK, then add a new build setting for Symbian Device.
  3. Select "Show Details" in the General build settings, then change the Tool Chain from WINSCW to GCCE.
  4. Click Symbian Device > Run. Expand Create SIS Package, and change the settings if needed. The default is to package an unsigned SIS file, but you can sign the SIS file with your own Symbian Signed certificate and key file. You can also package your Symbian application with Nokia Smart Installer (which is required for publishing mobile applications to Nokia Store using Ovi Publish).
  5. Build or Run the application.
Qtcreator-symbian-run-settings.png

[edit] makesis Command-line Tool

While Qt Creator is convenient for rapid development, sometimes you want to build the SIS package file from the command line. You can use makesis tool from the Symbian SDK for this purpose.

Browse to your application directory and locate your pkg file and use the makesis tool. Refer to the image below for illustration.

QtCreator Symbian4.jpg

You will get the SIS file in your application directory.

Now you can install it to your S60 device using Ovi Suite or Bluetooth transfer.

[edit] Managing Multiple Qt SDKs

Qt Creator can work with multiple Qt SDKs at once, and it should automatically detect Qt SDKs that have been configured for use with Qt Creator.

To inspect the configured Qt SDKs or add an additional Qt SDK: Click Tools menu > Options > Qt4 > Qt versions.

A Qt Creator project is flexible, it can use one or more Qt SDKs. You set the Qt SDK by going to Projects mode (Ctrl+5) and specifying which Qt SDK version to use for each build Target. Each target can have a different Qt SDK. For example, to compile for Qt Simulator, the Target should use Qt SDK for Qt Simulator. To build for Symbian device, configure the Target to use the Qt SDK.

This flexibility makes it very easy to develop, run, and test Qt applications for multiple target platforms at once.

Qt-creator-qt4-versions.png

[edit] Conclusion

As demonstrated, it is easy for the developer to start developing Symbian Applications using Qt Creator.

Especially with Qt Mobility APIs and Qt Simulator that is bundled with Nokia Qt SDK, developing Qt applications for Symbian that uses native mobile features are a straightforward process.

Previously, Symbian S60 SDKs were only available for Windows systems. Nokia Qt SDK makes developers lives easier because it is available for all desktop platforms (Windows, Linux, and Mac OS X).

So you can develop Symbian applications using any desktop operating system of your choice. (Some of the screenshots of Qt Creator above are captured while using the Linux-based Ubuntu 10.10 operating system.)

This page was last modified on 13 November 2012, at 06:59.
324 page views in the last 30 days.
×