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