Quick Start Qt for Windows, Symbian and Maemo MeeGo

download Quick Start Qt for Windows, Symbian and Maemo MeeGo

of 63

Transcript of Quick Start Qt for Windows, Symbian and Maemo MeeGo

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    1/63

    Andreas JaklSenior Technical Consultant

    Forum Nokia

    Quickstart

    Qt for Windows, Symbian andMaemo / MeeGo

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    2/63

    Task

    Run a Hello Worldapplication on

    Windows

    Maemo 5 device

    Symbian device

    Windows 7 Maemo 5

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    3/63

    Prerequisites

    Requirements for this tutorial:

    Windows XP / 7

    Development on Linux / Mac OS will be similar; full support c

    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

    special characters

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    4/63

    General Qt(plus: for Windows)

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    5/63

    All In: Qt SDKs

    Common Qt APIs

    Qt SDK forMac OS

    Mac OS X

    Qt SDK forLinux / X11

    Linux (X11)Symbian

    Nokia QtSDK

    MeeGo

    Simulator

    Qt SDK forWindows

    WindowsXP / Vista / 7

    Qt SDK forWindows CE

    WindowsCE / Mobile

    You can ofcourse install

    multiple SDKs atthe same time

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    6/63

    Nokia Qt SDK

    One-Click installation:

    Development tools

    Build for and debug in real devices

    Symbian

    MeeGo / Maemo

    Test on host PC Simulator

    Qt Mobility

    No extra device SDKs required anymore

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    7/63

    Installation

    Install Nokia Qt SDK

    For mobile development

    Install Qt SDK for Windows

    Optional

    For desktop development

    http://www.forum.nokia.com/Library/Tools_and_downloahttp://qt.nokia.com/downloads

    http://www.forum.nokia.com/Library/Tools_and_downloads/http://qt.nokia.com/downloadshttp://qt.nokia.com/downloadshttp://www.forum.nokia.com/Library/Tools_and_downloads/
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    8/63

    New Qt Project

    File New File or Project

    Empty Qt Project

    Project properties

    Name: Hello World

    Create in: workspace directory on same

    drive as tools, without space characters

    Qt versions

    Select all targets you are interested in

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    9/63

    Main Source File

    Project management

    Accept defaults

    Right-click on project Add New

    C++ source file

    Name: main.cpp

    Path: project path (default)

    Accept defaults on next page

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    10/63

    Hello World Source Code

    Write following code into empty main.cpp:

    #include

    #include

    int main(int argc, char *argv[])

    {

    QApplication app(argc, argv);

    QPushButton helloButton("Hello World");helloButton.resize(150, 50);

    helloButton.show();

    return app.exec();

    }

    main.cpp

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    11/63

    Run the Application

    Make sure Desktop is current build target

    Click on play arrow

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    12/63

    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

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    13/63

    Extend Hello World: Quit

    Add functionality to exit the Hello World example:

    Button emits clicked() signal

    Connected to QApplication::quit()

    QObject::connect(&helloButton, SIGNAL(clicked(

    &app, SLOT(quit()));

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    14/63

    Signals & 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 (e.g., quit())

    Also create your own slots

    Connection signals slots established by developer,

    handled by Qt framework

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    15/63

    Nokia Qt SDK: Simulator

    Efficient Testing

    Quick launch

    Scripting possibilities

    Using JavaScript

    Simulate phone events & Qt Mobility features

    Location, contacts, battery, messages, etc.

    Skins for different platforms / form-factors Resolutions, orientation, etc.

    No full phone emulator

    Only interact with your application. No ARM compiler involved.

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    16/63

    Launching the Qt Simulator

    Execute Hello World on Simulator

    Select Qt Simulator target

    Click on Play

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    17/63

    Qt for Maemo / MeeGo

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    18/63

    Qt for Maemo

    Development options

    Full Linux Environment (Scratchbox)

    Install Linux on your PC (e.g., Ubuntu)

    Guide: http://wiki.maemo.org/Documentation/Maemo_5_Final_SDK_Insta

    Or use VMware on Windows / Mac (a bit outdated)

    http://maemovmware.garage.maemo.org/

    Nokia Qt SDK (based on MADDE)

    Works on Windows, Linux, Mac OS X

    Full Qt support out of the box!

    http://wiki.maemo.org/Documentation/Maemo_5_Final_SDK_Installationhttp://maemovmware.garage.maemo.org/http://maemovmware.garage.maemo.org/http://wiki.maemo.org/Documentation/Maemo_5_Final_SDK_Installationhttp://wiki.maemo.org/Documentation/Maemo_5_Final_SDK_Installation
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    19/63

    MADDE

    MADDE?

    Comes with Nokia Qt SDK

    Maemo Application Development and

    Debugging Environment

    Toolchain that supports compiling and

    deploying MeeGo applications without settingup an own Linux environment

    Cross-Compilation

    http://wiki.maemo.org/MADDE

    http://wiki.maemo.org/MADDEhttp://wiki.maemo.org/MADDEhttp://wiki.maemo.org/MADDE
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    20/63

    Maemo MeeGo

    MeeGo fully compatible to Qt & Qt Creator

    As a 3rd party developer, most changes to the OS

    are irrelevant to you if you use Qt

    Start developing now on Maemo 5!

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    21/63

    Setting up the Device

    Configure your N900

    To enable direct deployment and debugging from Qt Creator

    Requires installing MAD Developer tools

    Add developer repositories to download tools

    Open the App manager on the N900

    Menu Application catalogues New Catalogue name: Extras

    Web address: http://repository.maemo.org/extras/

    Distribution: fremantle

    Components: free non-free

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    22/63

    Mad Developer

    Download and install

    mad-developer package

    In Application manager, click on Download All start typ

    on hardware keyboard to filter list and search for apps

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    23/63

    Qt Mobility (optional)

    N900 PR 1.2 Firmware (current)

    Contains Qt 4.6.2

    Doesnt ship with Qt Mobility packages

    Installation of Qt Mobility libraries

    Install package rootsh through App Manager

    Start X Terminal, type:

    $ sudo gainroot

    $ apt-get update

    $ apt-get install libqtm-*

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    24/63

    Connect the Device

    Select connection mode

    Start the Mad Developer application on the N900

    Click on Manage USB Load g_ether

    In any connection mode prompts that pop up, just close the dialog by clicking

    Make sure Module in use is g_ether and click close

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    25/63

    Connect the Device

    Configure USB / Ethernet connection

    Click on Edit and ensure following setup

    IP Address: 192.168.2.15

    Netmask: 255.255.255.0

    Click on Configure

    to apply

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    26/63

    Windows 7: Network and Sharing Center Change adapter settingsConfigure the PC

    Set a static IP for the USB Ethernet connection to the N900

    Open the Network Connections Right-click on the Local Area Connection of the Linux

    USB Ethernet/RNDIS Gadget device Properties

    Select Internet Protocol (TCP/IP) Properties

    Enter a static IP setting

    IP address: 192.168.2.14

    255.255.255.0

    Default gateway: 192.168.2.15 (or leave empty)

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    27/63

    Connect Qt Creator to Maemo Device

    Test the connection

    Start Qt Creator

    Options Qt4 Maemo Devices

    Add a device, choose a configuration

    name (e.g., N900)

    Ensure setup is as shown in screenshot

    Authentication type: Password

    Host Name: 192.168.2.15

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    28/63

    Connection Password

    Create password

    In Mad Developer, click onDeveloper Password

    Different pwd than in screenshot!

    New pwd generated every time

    Do not close the dialog windowshowing the pwd!

    Enter the password in Qt Creator Click on Test

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    29/63

    Deploy to N900

    Execute Hello World on N900

    Select Maemo target

    Click on Play

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    30/63

    Faster Execution: SSH Key

    Create SSH keys once instead of defining a new password for every conn

    Make sure your active connection with the password is workingGenerate SSH Key Generate SSH Key

    Save both the public and the private key to your computer

    Deploy the public key to your device, specify the private key on the PC

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    31/63

    Creating .deb for delivery I

    Creating project

    Create skeleton project through MADDE Terminal:http://wiki.maemo.org/MADDE/Qt_example

    In default directory of MADDE Terminal, type: mad pscreate t qt_simple

    Project will be located in: C:\NokiaQtSDK\Maemo\4.6.2\home\\

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    32/63

    Creating .deb for delivery II

    Create .deb and deploy

    Use MADDE terminal to build and create .deb

    Connect N900 in mass storage mode to PC, copy .deb to

    Nokia N900 disc / removable disk

    On device: start file manager, go to Nokia N900/ and

    click on the .deb file to initiate installation

    $ cd /

    $ mad qmake

    $ mad make$ mad dpkg-buildpackage

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    33/63

    Optification

    Storage memory on the N900

    256 MB NAND memory: Fast, but high power requirements

    not so big by design. For bootloader, kernel and root.

    32 GB eMMC: large, but slower.

    /home: ~ 2 GB

    /home/usr/MyDocs: ~ 29 GB

    Memory usage rules for applications

    Put large files on eMMC memory, not into small rootfs Optificati

    Required for Ovi Store submission: http://wiki.maemo.org/Ovi_Store_pu

    Documentation:http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Di

    nder_opt_and_MyDocs

    The Storage U

    gives a graphical ove

    and also lists the

    http://wiki.maemo.org/Ovi_Store_publishinghttp://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Distributing/Installing_under_opt_and_MyDocshttp://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Distributing/Installing_under_opt_and_MyDocshttp://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Distributing/Installing_under_opt_and_MyDocshttp://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Distributing/Installing_under_opt_and_MyDocshttp://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Distributing/Installing_under_opt_and_MyDocshttp://wiki.maemo.org/Ovi_Store_publishinghttp://wiki.maemo.org/Ovi_Store_publishing
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    34/63

    Faster .deb deployment and Un-Installing

    Instead of manually copying .deb, deploy through MADDE

    Create device runtime in MAD Terminal:

    http://wiki.maemo.org/MADDE/Device_runtime

    Deploy to N900 through terminal:

    Step 10 @ http://wiki.maemo.org/MADDE/Packaging

    Uninstallation

    Through N900 Application Manager

    Or Step 11 @ http://wiki.maemo.org/MADDE/Packaging

    http://wiki.maemo.org/MADDE/Device_runtimehttp://wiki.maemo.org/MADDE/Packaginghttp://wiki.maemo.org/MADDE/Packaginghttp://wiki.maemo.org/MADDE/Packaginghttp://wiki.maemo.org/MADDE/Packaginghttp://wiki.maemo.org/MADDE/Packaginghttp://wiki.maemo.org/MADDE/Packaginghttp://wiki.maemo.org/MADDE/Device_runtimehttp://wiki.maemo.org/MADDE/Device_runtime
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    35/63

    Qt for Symbian

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    36/63

    Symbian & Qt

    Qt for Symbian:

    Compatible to S60 3.1+ (Nokia N95, E71)

    Get your app running on 130 000 000 devices!

    Nokia devices platform versions:

    http://www.forum.nokia.com/devices/

    Series 601.0

    Series 602.0

    (+ 3 FPs)

    S603.0

    S603.1

    S603.2

    S605.0=

    Symbian^1

    Symbian^2 Symbia

    http://www.forum.nokia.com/devices/http://www.forum.nokia.com/devices/http://www.forum.nokia.com/devices/
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    37/63

    Install Qt to the Device < Symbian^3

    .sis-file: Symbian installation file

    Qt installation files in your Qt/Symbian SDK dir C:\NokiaQtSDK\Symbian\sis\qt_installer.sis: Installs Qt libraries

    C:\NokiaQtSDK\Symbian\sis\qt_mobility.sis: Contains additional Qt Mob

    C:\NokiaQtSDK\Symbian\sis\fluidlauncher.sis: Installs demos

    Installation to mass memory. Choose one method:

    1. Send through Bluetooth to device2. Use Ovi Suite, connect your device and double-click .sis-file

    3. Copy .sis-file to device / SD card and start installation through file man

    Restart the device

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    38/63

    Automatic Deployment & On-Device Deb

    Requires debug agent running on device: App TRK

    Install: C:\NokiaQtSDK\Symbian\sis\s60_5_0_app_trk_3_x_x.sisx

    (for S60 5.0. Choose appropriate TRK for your phone.

    S^3 requires different TRK* than S60 5.0!)

    Install to phone memory (C:\)

    Run the TRK on the device

    Setup connection using Bluetooth or USB cable

    Recommended: USB

    * http://tools.ext.nokia.com/trk/s60_tb_9_2_app_trk_3_2_7.sisx

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    39/63

    TRK: USB Connection

    Debugging through USB is faster and easier

    Very first start of TRK on device: cancel Bluetooth connection

    i h i C i

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    40/63

    Testing the 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

    H ll W ld S bi

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    41/63

    Hello World on Symbian

    S t I t ll

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    42/63

    Smart Installer

    Distribute Qt apps on Symbian devices

    Qt pre-installed Symbian^3 onwards

    Solution for pre-Symbian^3:

    installation / update on demand

    Package Smart Installer with your app

    More information

    http://wiki.forum.nokia.com/index.php/Nokia_Smart_Installer_for_Sy

    Si i & C tifi t

    http://wiki.forum.nokia.com/index.php/Nokia_Smart_Installer_for_Symbianhttp://wiki.forum.nokia.com/index.php/Nokia_Smart_Installer_for_Symbianhttp://wiki.forum.nokia.com/index.php/Nokia_Smart_Installer_for_Symbian
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    43/63

    Signing & Certificates

    Self-Signed application (default):

    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

    Access to APIs (Capabilities)

    for sensitive features (calendar, location, etc.)Self-Sign

    app install

    S bi Di t ib ti

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    44/63

    Symbian Distribution

    Now free through Ovi Publish program

    Sign up:

    http://www.forum.nokia.com/Distribute/Pack

    aging_and_signing.xhtml

    Get test certificate for development

    (if you require restricted capabilities in

    your app)

    Thoroughly test your app:http://tiny.symbian.org/testcriteria

    Submit finished app to Ovi Store for free

    Test your app according to test criteria

    Publisher ID from TrustCent

    $200 / year, only for c

    Allows creating devel

    http://www.trustcent

    sher_id_for_symbian.h

    Sign your app through:

    Express Signed: insta

    Certified Signed: exter

    https://www.symbian

    http://www.forum.nokia.com/Distribute/Packaging_and_signing.xhtmlhttp://www.forum.nokia.com/Distribute/Packaging_and_signing.xhtmlhttp://tiny.symbian.org/testcriteriahttp://www.trustcenter.de/en/products/tc_publisher_id_for_symbian.htmhttp://www.trustcenter.de/en/products/tc_publisher_id_for_symbian.htmhttps://www.symbiansigned.com/https://www.symbiansigned.com/http://www.trustcenter.de/en/products/tc_publisher_id_for_symbian.htmhttp://www.trustcenter.de/en/products/tc_publisher_id_for_symbian.htmhttp://tiny.symbian.org/testcriteriahttp://www.forum.nokia.com/Distribute/Packaging_and_signing.xhtmlhttp://www.forum.nokia.com/Distribute/Packaging_and_signing.xhtml
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    45/63

    Good to Know

    T ki S h t

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    46/63

    Taking Screenshots

    Maemo

    Ctrl + Shift + P: Saves to /home/user/MyDocs/.images/Scree

    Symbian

    Download Best Screen Snap for S60 (Freeware)

    http://www.smartphoneware.com/screen_snap-for-s60-5th-edition-downloa

    Set image type to BMP true color for maximum quality

    Working with GIT from Windows

    http://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.phphttp://www.smartphoneware.com/screen_snap-for-s60-5th-edition-download.php
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    47/63

    Working with GIT from Windows

    Use bleeding edge code?

    Qt developed as open source

    You can download latest development source from GIT repo

    Warning: not for beginners! Needs manual compilation.

    Commercial ARM compiler required for compiling Qt for Sym

    Install Windows client software

    msysgit: http://code.google.com/p/msysgit/

    TortoiseGit: http://code.google.com/p/tortoisegit/

    Downloading from GIT

    http://code.google.com/p/msysgit/http://code.google.com/p/tortoisegit/http://code.google.com/p/tortoisegit/http://code.google.com/p/tortoisegit/http://code.google.com/p/msysgit/http://code.google.com/p/msysgit/
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    48/63

    Downloading from GIT

    Search repository you want to download locally (clone)

    http://qt.gitorious.org/

    Get repository URL

    Clone the repository

    In Windows Explorer, go to

    parent of target directory(e.g., C:\Qt\)

    Right-click Git Clone

    Downloading from GIT

    http://qt.gitorious.org/http://qt.gitorious.org/http://qt.gitorious.org/
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    49/63

    Downloading from GIT

    Configure download

    Enter repository URL

    Make sure your firewall / proxy doesnt

    block download

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    50/63

    Troubleshooting

    Troubleshooting: Qt Not Found

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    51/63

    Troubleshooting: Qt Not Found

    Situation

    Full Qt for Windows SDK is installed, created a Qt Creator project

    Problem

    Error when compiling, similar to:

    Solution

    Go to Tools Options Qt4. Click on the + button to define a manua

    the QMake and MinGW location to your SDK dirs (see screenshot on next

    No valid Qt version set. Set one in Tools/OptionsError while building project GuiTest

    When executing build step 'QMake'

    Canceled build.

    Troubleshooting: Qt Not Found

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    52/63

    Troubleshooting: Qt Not Found

    SolutionAdd Qt m

    Troubleshooting: Network Drives

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    53/63

    Troubleshooting: Network Drives

    Situation

    Created / opened a project on a network drive on Windows

    Problem

    Error when compiling, similar to:

    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 le

    the ///-path

    Error processing project file: //fshome/.../TestProject.pro

    Exited with code 3.

    Error while building project TestProject

    When executing build step 'QMake'

    Troubleshooting: vtable references

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    54/63

    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:

    Build Clean All doesnt help

    debug/myclass.o: In function `MyClass':C:\Qt\workspace\Foo/myclass.cpp:3: undefined reference to `vtable for MyClass'

    C:\Qt\workspace\Foo/myclass.cpp:3: undefined reference to `vtable for MyClass'

    collect2: ld returned 1 exit statusmingw32-make[1]: *** [debug\Foo.exe] Error 1

    mingw32-make: *** [debug] Error 2Exited with code 2.

    Troubleshooting: vtable references II

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    55/63

    Troubleshooting: vtable references II

    Solution

    Qt Creator doesnt necessarily recognize changes, as your claneeds to be processed using the meta object compiler (moc)

    compilation process.

    Simple solution:

    Directly delete makefiles from

    explorer / terminal and

    compile again. This ensures that

    all makefiles are re-generated.

    Troubleshooting: Widgets Not Declared

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    56/63

    Troubleshooting: Widgets Not Declared

    Situation

    Created a console application

    Added GUI elements

    Problem

    Error when compiling, similar to:

    Solution Remove the following lines from the .pro-file:

    QT -= gui

    CONFIG += console

    main.cpp:9: error: 'QPushButton' was not declared in this scope

    Troubleshooting: Qt DLLs

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    57/63

    Troubleshooting: Qt DLLs

    Situation

    Successfully compiled application, execution through Qt Crea

    Problem

    When executing .exe-file directly through Windows Explorer

    message DLL files not found.

    Common: mingwm10.dll, qtcore4.dll, qtgui4.dll, qtcored4.d

    Troubleshooting: Qt DLLs II

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    58/63

    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:\NokiaQtSDK\mingw\bin;

    C:\Qt\2010.02\qt\bin

    Not allowed to modify PATH? Copy required DLLs to executable

    directory.

    More information: http://doc.qt.nokia.com/deployment-

    windows.html

    Troubleshooting: DLL Entry Point

    http://doc.qt.nokia.com/deployment-windows.htmlhttp://doc.qt.nokia.com/deployment-windows.htmlhttp://doc.qt.nokia.com/deployment-windows.htmlhttp://doc.qt.nokia.com/deployment-windows.htmlhttp://doc.qt.nokia.com/deployment-windows.htmlhttp://doc.qt.nokia.com/deployment-windows.html
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    59/63

    Troubleshooting: DLL Entry Point

    Situation

    Successfully compiled application, executing .exe through Windows Expl

    Problem

    Error message like:

    Solution

    Wrong version of dynamically linked Qt Dll was found and is used by Win

    Modify PATH environment variable, move Qt directories to the front of Sy

    Or: copy DLLs to executable directory.

    The procedure entry point ?end@QListData@@QBEPAPAXXZ

    could not be located in the dynamic link library QtCore4.dll

    sis Installation Fails

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    60/63

    .sis Installation Fails Situation

    Successfully compiled application for a Symbian device

    Problem Installation fails with an error message like:

    Solution Install the .sis-file manually through the Nokia Ovi Suite or by simply sending the

    phone using Bluetooth or an USB connection.

    You will then see the full error message on the device. For example, you might ha

    version installed on your phone.

    Deploying application to 'Nokia N97 mini USB (COM9)'...Copying installation file...

    Installing application...

    Could not install from package C:\xxx.sis on device: General OS-related errorFinished.

    sis Installation Fails II

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    61/63

    .sis Installation Fails II Common issues

    Certificate validity: are both PC and device date & time correct?

    Changed certificate type or UID: uninstall old app version from device before insta Correct certificate: only User Capabilities can be used with self-signed certifica

    default from Qt Creator. For other capability groups, you need a developer certificat

    through Publish to Ovi.

    http://developer.symbian.org/wiki/index.php/Capabilities_%28Symbian_Signed%2

    Checklist: http://developer.symbian.org/wiki/index.php/Troubleshoot_install_error

    Getting more details

    Install ErrRd utility to the phone: http://www.symbianresources.com/cgi-bin/schla

    You will get error code during installation. Overview of codes:

    http://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/t

    software-installer-debug-guide

    Troubleshooting: .sis vs .sisx?

    http://developer.symbian.org/wiki/index.php/Capabilities_(Symbian_Signed)http://developer.symbian.org/wiki/index.php/Troubleshoot_install_errorshttp://www.symbianresources.com/cgi-bin/schlabo/dl.pl?ErrRdhttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://blogs.forum.nokia.com/blog/lucian-tomuas-forum-nokia-blog/2009/09/29/the-ultimate-software-installer-debug-guidehttp://www.symbianresources.com/cgi-bin/schlabo/dl.pl?ErrRdhttp://www.symbianresources.com/cgi-bin/schlabo/dl.pl?ErrRdhttp://www.symbianresources.com/cgi-bin/schlabo/dl.pl?ErrRdhttp://www.symbianresources.com/cgi-bin/schlabo/dl.pl?ErrRdhttp://developer.symbian.org/wiki/index.php/Troubleshoot_install_errorshttp://developer.symbian.org/wiki/index.php/Capabilities_(Symbian_Signed)
  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    62/63

    Troubleshooting: .sis vs .sisx?

    Whats the difference?

    No difference to Symbian device, its just the filename.

    Common: .sisx = signed version of unsigned .sis. But:

    Nokia Qt SDK: .sis is already signed, no .sisx is created!

    When not specifying own certificate: .sis is self-signed with

    automatically generated certificate

    Installation of self-signed apps not allowed by default on

    some operator branded devices

    Change: Application manager Installation settings

    Software installation change from Signed only to All

  • 8/4/2019 Quick Start Qt for Windows, Symbian and Maemo MeeGo

    63/63

    Thank You.

    Want to learn more?www.forum.nokia.com/Qt

    http://www.forum.nokia.com/Qthttp://www.forum.nokia.com/Qt