2. Task
â Run a Hello World application on
ï Windows
ï Maemo 5 device
ï Symbian device
Windows 7 Maemo 5 Symbian^1
(S60 5th Edition)
2 Andreas Jakl, 2010
3. Prerequisites
â Requirements for this tutorial:
ï Windows XP / Vista / 7
ï Around 7.5 GB free disk space for Qt + Symbian + Maemo
â General hints:
ï Install all tools to the same drive (e.g., C:)
ï Do not use network drives
ï Use default installation paths. Be wary of paths that contain
spaces / special characters
3 Andreas Jakl, 2010
5. Qt for Windows (Desktop)
â Install Qt SDK for Windows
ï Choose free LGPL version
ï Contains Qt Creator DIE
ï http://qt.nokia.com/downloads
5 Andreas Jakl, 2010
6. Qt Creator for Maemo / Symbian
â For better Maemo & Symbian compatibility:
ï Download and install
Qt Creator 1.3.80+ snapshot:
http://qt.nokia.com/developer/qt-snapshots
ï Select âPost mortem debuggingâ
during installation
ï Ignore any warnings related to
QML components not being found
ï Tested with version from 3.3.2010
6 Andreas Jakl, 2010
7. New Qt Project
2
1 File â New File or ProjectâŠ
â
3
2 Empty Qt Project
â
3 Project properties
â
ï Name: Hello World
ï Create in: workspace directory won same 4
drive as tools, without space characters
4 Qt versions
â
ï If already installed: select all targets you are
interested in (e.g., Maemo device, S60 device)
7 Andreas Jakl, 2010
8. Main Source File 5
5 Project management
â
ï Accept defaults
6 Right-click on project â Add New⊠â
â
6
C++ source file
ï Name: main.cpp
ï Path: project path (default)
ï Accept defaults on next page
8 Andreas Jakl, 2010
9. Hello World â Source Code
7 Write following code into empty main.cpp:
â
main.cpp
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton helloButton("Hello World");
helloButton.resize(150, 50);
helloButton.show();
return app.exec();
}
9 Andreas Jakl, 2010
10. Run the Application
7 Make sure âDesktopâ is current build target
â
8 Click on play arrow
â
7
8
10 Andreas Jakl, 2010
11. Hello World â Components
â QApplication
ï One per GUI app
ï Manages app-wide resources (default font, cursor, ...)
â QPushButton
ï Default widget, based on QWidget
ï Can process user input and draw graphics
11 Andreas Jakl, 2010
12. Quit Hello World
â Add functionality to exit the Hello World example:
QObject::connect(&helloButton, SIGNAL(clicked()),
&app, SLOT(quit()));
ï Button emits clicked() signal
ï Connected to QApplication::quit()
12 Andreas Jakl, 2010
13. Signals and Slots
â Signal
ï Emitted when a particular event occurs (e.g., clicked())
ï Qt widgets: predefined signals
ï Also create your own signals
â Slot
ï Function called in response to a signal
ï Qt widgets: predefined slots
ï Also create your own slots
â Connection signals ï± slots established by developer,
handled by Qt framework
13 Andreas Jakl, 2010
14. Troubleshooting: Qt Not Found
â Situation
ï Full Qt SDK is installed, created a Qt Creator project
â Problem
ï Error when compiling, similar to:
No valid Qt version set. Set one in Tools/Options
Error while building project GuiTest
When executing build step 'QMake'
Canceled build.
â Solution
ï Go to Tools â Options â Qt4. Click on the â+â button to define a manual Qt version.
Set the QMake and MinGW location to your SDK dirs (see screenshot on next slide)
14 Andreas Jakl, 2010
16. Troubleshooting: Widgets Not Declared
â Situation
ï Created a console application
ï Added GUI elements
â Problem
ï Error when compiling, similar to:
main.cpp:9: error: 'QPushButton' was not declared in this scope
â Solution
ï Remove the following lines from the .pro-file:
QT -= gui
CONFIG += console
16 Andreas Jakl, 2010
17. Troubleshooting: Network Drives
â Situation
ï Created / opened a project on a network drive on Windows
â Problem
ï Error when compiling, similar to:
Error processing project file: //fshome/.../TestProject.pro
Exited with code 3.
Error while building project TestProject
When executing build step 'QMake'
â Solution
ï Create your project on a local drive, not a network drive.
If a network drive is required, make sure it is accessed through a drive letter instead
of the //âŠ/-path
17 Andreas Jakl, 2010
18. Troubleshooting: vtable references
â Situation
ï Added metaobject functionality to existing plain C++ class
(signals / slots, added derivation from QObject,
added Q_OBJECT macro)
â Problem
ï Error when compiling, similar to:
debug/myclass.o: In function `MyClass':
C:QtworkspaceFoo/myclass.cpp:3: undefined reference to `vtable for MyClass'
C:QtworkspaceFoo/myclass.cpp:3: undefined reference to `vtable for MyClass'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debugFoo.exe] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
ï Build â Clean All doesnât help
18 Andreas Jakl, 2010
19. Troubleshooting: vtable references II
â Solution
ï Qt Creator doesnât necessarily recognize changes, as your
class now needs to be processed using the meta object
compiler (moc) during the compilation process.
ï Simple solution:
Directly delete makefiles from
explorer / terminal and
compile again. This ensures that
all makefiles are re-generated.
19 Andreas Jakl, 2010
20. Troubleshooting: Qt DLLs
â Situation
ï Successfully compiled application, execution through Qt
Creator works.
â Problem
ï When executing .exe-file directly through Windows
Explorer: error message â DLL files not found.
ï Common: mingwm10.dll, qtcore4.dll, qtgui4.dll,
qtcored4.dll, qtguid4.dll
20 Andreas Jakl, 2010
21. Troubleshooting: Qt DLLs II
â Solution
ï Search for location of DLL files on PC, add directories to
system environment variables.
ï ïż-Key + Pause â Advanced system settings â Advanced
â Environment VariablesâŠ
Add at the end of Path variable in user or system variables.
ï Commonly needed:
C:Qt2010.02mingwbin;
C:Qt2010.02qtbin
ï Not allowed to modify PATH? Copy required DLLs to
executable directory.
ï More information:
http://qt.nokia.com/doc/4.6/deployment-windows.html
21 Andreas Jakl, 2010
22. Troubleshooting: DLL Entry Point
â Situation
ï Successfully compiled application, executing .exe through Windows Explorer
â Problem
ï Error message like:
The procedure entry point ?end@QListData@@QBEPAPAXXZ
could not be located in the dynamic link library QtCore4.dll
â Solution
ï Wrong version of dynamically linked Qt Dll was found and is used by
Windows.
ï Modify PATH environment variable, move Qt directories to the front of
System Variables. Or: copy DLLs to executable directory.
22 Andreas Jakl, 2010
24. Qt for Maemo
â Development options
ï Full Linux Environment
â Install Linux on your PC (e.g., Ubuntu)
â VMware on Windows / Mac
â http://maemovmware.garage.maemo.org/
ï MADDE
â Maemo Application Development and Debugging Environment
â Works on Windows, Linux, Mac OS X
â http://wiki.maemo.org/MADDE
24 Andreas Jakl, 2010
25. MADDE
â Toolchain that supports compiling and deploying Maemo
applications without setting up an own Linux environment
â Status
ï Technical Preview
ï Supports Qt 4.5.3
â Qt version of Maemo Firmware PR1.1
â Will switch to Qt 4.6 with PR1.2
ï http://wiki.maemo.org/MADDE
25 Andreas Jakl, 2010
26. MADDE â Deploying Hello World to N900
â Integration with Qt Creator 1.3.80+
â Follow setup steps from:
ï http://wiki.maemo.org/MADDE/QtCreator_integration_for_windows
1. Add Extras-devel repository to N900
2. Install and configure MAD Developer tools on the N900
3. Install and configure USB Connectivity tool on PC
4. Setup device connection and password in Qt Creator
26 Andreas Jakl, 2010
27. MeeGo
â Fully compatible to Qt & Qt Creator
â Distribution to be released soon
â Planned support:
ï MADDE compatible toolchain
ï Virtual Machine image
27 Andreas Jakl, 2010
29. Symbian: Prerequisites
â Install ActivePerl 5.6.x or 5.8.9 from ActiveState
ï http://downloads.activestate.com/ActivePerl/releases/5.8.9
.827/ActivePerl-5.8.9.827-MSWin32-x86-291969.msi
29 Andreas Jakl, 2010
30. Symbian: Development Environment
â Step 2: Development Environment
ï Install the latest ADT (Application Development Toolkit)
http://developer.symbian.org/main/tools_and_kits/downlo
ads/view.php?id=2
ï If ADT still contains
Carbide.c++ v2.3, download
and extract the latest
development build of v2.5 from:
http://tools.ext.nokia.com/download/dev_build.php
30 Andreas Jakl, 2010
31. Symbian: Device SDK
â Qt for Symbian:
ï Compatible to S60 3rd. Edition, FP1+ (Nokia N95, E71)
ï Install SDK for your device, or lowest denominator for devices you want
to support with your product
â Info about system version of Nokia S60 devices:
http://www.forum.nokia.com/devices/
ï Now: install S60 5th Edition (touch-support):
http://www.forum.nokia.com/info/sw.nokia.com/id/ec866fab-4b76-49f6-b5a5-
af0631419e9c/S60_All_in_One_SDKs.html
Qt Compatibility
Series 60 Series 60 S60 S60 S60 S60 Symbian^2 Symbian^3 Symbian^4
1st Ed. 2nd Ed. 3 rd Ed. 3 rd Ed. 3 rd Ed. 5thEd.
(+ 3 FPs) FP1 FP2 =
Symbian^1
31 Andreas Jakl, 2010
32. Extend S60 SDK
â Windows Vista / 7: Compatibility Issues
ï http://developer.symbian.org/wiki/index.php/Kits_Q%26As#Can_I_Use_the_Kit
s_on_Windows_Vista.3F
â Install OpenC 1.6+ SDK Plug-In:
ï Port of standard C libraries to Symbian platform
ï Required by Qt
ï http://www.forum.nokia.com/info/sw.nokia.com/id/91d89929-fb8c-4d66-bea0-
227e42df9053/Open_C_SDK_Plug-In.html
32 Andreas Jakl, 2010
33. Symbian: Qt
â Install Qt framework for
Symbian
ï Qt for Windows-SDK only
contains libraries for
Windows deployment
ï http://qt.nokia.com/downloads
33 Andreas Jakl, 2010
34. Install Qt to the Device
â .sis-file: Symbian installation file
â Qt installation files in your Qt/Symbian SDK dir
ï C:Qt4.6.2qt_demos.sis: Installs Qt + dependencies + demos
ï C:Qt4.6.2qt_installer.sis: Same as above, without demos
â Installation to mass memory. Choose one method:
1. Send through Bluetooth to device
2. Use Ovi Suite, connect your device and double-click .sis-file
3. Copy .sis-file to device / SD card and start install through file manager
on device
â Restart the device
34 Andreas Jakl, 2010
35. Automatic Deployment & On-Device Debug
â Requires App TRK running on device: debug client
â Install:
ï http://tools.ext.nokia.com/trk/
ï s60_5_0_app_trk_3_1_2.sisx
â Run the TRK on the device
ï Setup connection using Bluetooth or
USB cable
35 Andreas Jakl, 2010
36. Device Connection
â Go to the Run Settings tab of the Symbian Device
â Click on the i symbol to check the active TRK connection
â Press play to deploy and run
36 Andreas Jakl, 2010
38. Smart Installer for Symbian
â Automatically downloads and installs Qt on end user device
(if required)
ï Enables commercial deployment
ï Ensures up to date Qt version on devices
ï Reduces installation file size
â http://qt.nokia.com/developer/nokia-smart-installer-for-symbian
38 Andreas Jakl, 2010
39. Signing & Certificates
Open Signed
(Developer Certificate)
â Self-Signed application:
ï Security warning during installation
ï No access to restricted features
(e.g., powering off the device)
â Reasons for signing:
ï Prevent sabotage of installation files (.sis)
ï Identification of the software developer
ï Extended access to APIs (Capabilities)
for sensitive features (calendar, location, etc.)
ï Get rid of warning during installation
Self-Signed
39 Andreas Jakl, 2009
app installation
40. Symbian Distribution
â Requires Publisher ID from TrustCenter
ï $200 / year
ï Only for companies
ï http://www.trustcenter.de/en/products/tc_publisher_id_for_symbian.htm
â Test your app according to test criteria
ï http://tiny.symbian.org/testcriteria
â Sign your app through:
ï Express Signed: instant, $20
ï Certified Signed: external test house, âŹ185+
ï https://www.symbiansigned.com/
â Distribute through own homepage or app stores (like Nokia Ovi Store)
40 Andreas Jakl, 2010
41. Further Reading
â Qt for Symbian Tutorials
ï http://developer.symbian.org/wiki/index.php/Qt_Quick_Start
ï http://qt.nokia.com/doc/4.6/install-symbian.html
ï http://qt.nokia.com/doc/qtcreator-1.3/creator-qt-for-symbian.html
ï http://www.forum.nokia.com/Technology_Topics/Development_Platfor
ms/Qt/
41 Andreas Jakl, 2010
42. Troubleshooting: .sis vs .sisx
â Both have been created, installing .sis:
â .sisx = signed version of the .sis
â When not specifying own certificate: self-
signed with automatically generated
certificate
â Installation of self-signed apps not allowed
by default on some (branded) devices
ï Change: Application manager ï§ Installation
settings ï§ Software installation ï§ change
from âSigned onlyâ to âAllâ
42 Andreas Jakl, 2009
43. Troubleshooting: .sis-Creation
â Situation
ï Successfully compiled, app not transferred to the Symbian device
â Problem
ï Error message in Application Output window
Successfully created helloworld.sis for debug-gcce using certificate: C:Qt4.6.2-symsrcs60installsselfsigned.cer!
Failed to create 'C:QtworkspaceHelloWorldHelloWorld_debug-gcce.sis'
â Solution
ï Issue of current pre-release of Qt Creator
ï Install helloworld.sis manually, or use stable Qt Creator 1.3.1 for
deployment to Symbian device
43 Andreas Jakl, 2010