Skip to content
Snippets Groups Projects
qtcreator.qdoc 252 KiB
Newer Older
    Qt Creator automatically adds \gui{Run Configurations} for all targets
    specified in the \c CMake project file.
    Known issues for the current version can be found
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed


    \section1 Adding External Libraries to a CMake Project

    Through external libraries Qt Creator can support code completion and
    syntax highlighting as if they were part of the current project or the Qt
    library.

    Qt Creator detects the external libraries using the \c FIND_PACKAGE()
    macro. Some libraries come with the CMake installation. You can find those
    in the \bold{Modules} directory of your CMake installation.

    \note If you provide your own libraries, you also need to provide your own
    \c FindFoo.cmake file. For more information, see
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \l{http://vtk.org/Wiki/CMake_FAQ#Writing_FindXXX.cmake_files}{CMake FAQ}.

    Syntax completion and highlighting work once your project successfully
    builds and links against the external library.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \previouspage creator-project-cmake.html
    \page creator-project-generic.html
Leena Miettinen's avatar
Leena Miettinen committed
    \nextpage creator-developing-maemo.html
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

    \title Setting Up a Generic Project

    Qt Creator supports generic projects, so you can import existing projects
    that do not use qmake or CMake and Qt Creator ignores your build system.
    Generic project support allows you to use Qt Creator as a code editor. You
    can change the way your project is built by modifying the \c make command
    in the \gui{Projects} mode under \gui{Build Settings}.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    When you import a project, Qt Creator creates the following files that
    allow you to specify which files belong to your project and which include
    directories or defines you want to pass to your compile:
    \tt{.files}, \tt{.includes}, and \tt{.config}.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 Importing a Generic Project

    To import an existing generic project:
    \list 1
        \o Select \gui File > \gui{New File or Project...} >
           \gui{Other Project} > \gui{Import Existing Project}.
        \o In \gui{Import Existing Project}, enter the project name
           and select the location of the project file you want to import.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

           Qt Creator automatically generates the following files in the
           project directory:
           \list
               \o \l{Specifying Files}{.files}
               \o \l{Specifying Include Paths}{.includes}
               \o \l{Specifying Defines}{.config}
               \o .creator
           \endlist
    \endlist

    When the project is successfully imported, Qt Creator creates the project
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    tree in the sidebar.

    After importing a generic project into Qt Creator, open it by selecting the
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed


    \section1 Working with Generic Project Files
    For a generic project, you have to manually specify which files belong to
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    your project and which include directories or defines you want to pass to
    your compiler.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 Specifying Files
    The list of files for a generic project is specified in the \tt{.files}
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    file. When you first create a generic project, Qt Creator adds any
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    files it recognizes to your project.

    To add or remove files, edit the \tt{.files} file in Qt Creator.
    Qt Creator recreates your project tree when you save the \tt{.files} file.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    Alternatively, you can add and remove files using the context menu in the
    project tree.
    If you frequently need to update the \tt{.files} file, you can do so
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    efficiently by using a script that updates the file for you. If the file
    is modified externally, you have to restart Qt Creator for the changes to
    take effect.
    To update the \tt{.files} on the \gui Git repository use the following
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    script:
    \code
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \endcode
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 Specifying Include Paths
    The include paths are specified in the \tt{.includes} file, one include
    path per line. The paths can be either absolute or relative to the
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 Specifying Defines
    The defines are specified in the \tt{.config} file. The \tt{.config} file is
    a regular C++ file, prepended to all your source files when they are parsed.
    Only use the \tt{.config} file to add lines as in the example below:
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 Creating a Run Configuration
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    Qt Creator cannot automatically determine which executable to run.

    In the \gui{Projects} mode under \gui{Run Settings}, define the executable
    file to run:
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \list 1
        \o Click \gui Add and select \gui{Custom Executable}.
        \o Define the configuration name, the location of the executable, any
           additional arguments and the working directory.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \endlist

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

/*!

    \contentspage index.html
    \previouspage adding-plugins.html
    \nextpage quick-projects.html
    You can either create Qt Quick projects from scratch or import them to
    Qt Creator. For example, you can import and run the
    \l {http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeexamples.html} {QML examples and demos}
    to learn how to use various aspects of QML.
    You can use the code editor (\l{Using the Editor}{Edit mode}) or the visual editor
    (\l{Using Qt Quick Designer}{Design mode}) to develop Qt Quick applications.
    The following sections describe typical tasks you can do with Qt Creator.

    \list

        \o \l {Creating Qt Quick Projects}
        \o \l {Creating Components}
        \o \l {Creating Screens}
        \o \l {Animating Screens}
        \o \l {Adding User Interaction Methods}
        \o \l {Implementing Application Logic}

    \endlist
    \note The \QMLD visual editor is provided as an experimental plugin that you must
    enable to be able to edit QML files in the \gui Design mode. Enabling the
    visual editor can negatively affect the overall stability of Qt Creator.

    To enable or disable the \QMLD visual editor, select
    \gui {Help > About Plugins... > Qt Quick > QmlDesigner}. You must restart Qt Creator
    to enable or disable the visual editor.

*/


/*!

    \contentspage index.html
    \previouspage creator-visual-editor.html
    \page quick-projects.html
    \nextpage quick-components.html

    \title Creating Qt Quick Projects
    Select \gui {File > New File or Project > Qt Quick Project > Qt QML Application}.
    \image qmldesigner-new-project.png "New File or Project dialog"

    Qt Creator creates the following files:

    \list

    \o .qmlproject project file defines that all QML, JavaScript, and image
    files in the project folder belong to the project. Therefore, you do not
    need to individually list all the files in the project.

    \o .qml file defines an element, such as a component, screen, or the whole
    The \c import statement in the beginning of the .qml file specifies the
    \l {http://doc.qt.nokia.com/4.7-snapshot/qdeclarativemodules.html} {Qt modules}
    to import. Each Qt module contains a set of default elements.
    To use JavaScript and image files in the application, copy them to the
    project folder.

    To import a QML project to Qt Creator, select
    \gui {File > New File or Project > Qt Quick Project > Import Existing Qt QML Directory}.
    \previouspage quick-projects.html
    \page quick-components.html
    \nextpage quick-screens.html

    \title Creating Components
    A QML component provides a way of defining a new type that you can re-use in other QML
    files. A component is like a black box; it interacts with the outside world
    through properties, signals, and slots, and is generally defined in its own QML file.
    You can import components to screens and applications.
    You can create the following QML components:
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-borderimage.html}{Border Image}
        uses an image as a border or background.
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-image.html}{Image}
        adds a bitmap to the scene. You can stretch and tile images.
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-item.html}{Item}
        is the most basic of all visual items in QML. Even though it has no visual appearance,
        it defines all the properties that are common across visual items, such as the x and
        y position, width and height, anchoring, and key handling.
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-rectangle.html}{Rectangle}
        adds a rectangle that is painted with a solid fill color and an optional border.
        You can also use the radius property to create rounded rectangles.
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-text.html}{Text}
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-textedit.html}{Text Edit}
        adds a single line of editable formatted text that can be validated.
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-textinput.html}{Text Input}
        adds a single line of editable plain text that can be validated.

    \endlist
    \previouspage quick-components.html
    \page quick-screens.html
    \nextpage quick-animations.html

    \title Creating Screens
    You can use predefined QML elements and your own components to create screens.

    You can create the following types of views to organize items provided by
    \l{http://doc.qt.nokia.com/4.7-snapshot/qdeclarativemodels.html}{data models}:
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-gridview.html}{Grid View}
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-listview.html}{List View}
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-pathview.html}{Path View}

    \endlist

    In the code editor, write the code to use the data models.

    Use states and transitions
    QML states typically describe user interface configurations, such as the UI elements,
    their properties and behavior and the available actions. For example, you can use
    \previouspage quick-screens.html
    \page quick-animations.html
    \nextpage quick-user-interaction.html

    \title Animating Screens
    To make movement between states smooth, you can specify transitions.
    You can use different types of animated transitions. For example, you can animate changes
    to property values and colors. You can use rotation animation to control the direction of
    rotation. For more information, see
    \l{http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeanimation.html}{QML Animation}.
    You can use the \c ParallelAnimation element to start several animations at the same time.
    Or use the \c SequentialAnimation element to run them one after another.

    You can use the code editor to specify transitions. For more information, see
    \l{http://doc.qt.nokia.com/4.7-snapshot/qml-transition.html}{QML Transition Element}.

*/


/*!

    \contentspage index.html
    \previouspage quick-animations.html
    \page quick-user-interaction.html
    \nextpage quick-application-logic.html
    \title Adding User Interaction Methods
    You can add the following basic interaction methods to scenes:

    \list

        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-flickable.html}{Flickable}
        items can be flicked horizontally or vertically.
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-flipable.html}{Flipable}
        items can be flipped between their front and back sides by using rotation,
        state, and transition.
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-focusscope.html}{Focus Scope}
        assists in keyboard focus handling when building reusable QML components.
        \o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-mousearea.html}{Mouse Area}
*/


/*!

    \contentspage index.html
    \previouspage quick-user-interaction.html
    \page quick-application-logic.html
    \nextpage creator-building-running.html

    \title Implementing Application Logic
    A user interface is only a part of an application, and not really useful by itself.
    You can use Qt or JavaScript to implement the application logic. For more information on
    using JavaScript, see
    \l {http://doc.qt.nokia.com/4.7-snapshot/qdeclarativejavascript.html} {Integrating JavaScript}.

    For an example of how to use JavaScript to develop a game, see the
    \l {http://doc.qt.nokia.com/4.7-snapshot/qml-advtutorial.html} {QML Advanced Tutorial}.
Leena Miettinen's avatar
Leena Miettinen committed
    \previouspage creator-project-generic.html
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \page creator-developing-maemo.html
    \nextpage creator-developing-symbian.html

Leena Miettinen's avatar
Leena Miettinen committed
    \title Setting Up Development Environment for Maemo
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

    Maemo is a software platform developed by Nokia for smartphones and
    Internet Tablets. The Maemo SDK provides an open development environment
    for different applications on top of the Maemo platform. The necessary
    tools from the Maemo SDK are also included in the Nokia Qt SDK.
    The whole tool chain that you need to create, build, debug, run, and deploy
    Maemo applictions is installed and configured when you install the Nokia
    Qt SDK.

    Maemo 5 is based on the Linux 2.6 operating system. For more
    information about the Maemo platform, see
    \l{http://maemo.org/intro/platform/}{Software Platform} on the Maemo web site.
    For more information about developing applications for the Maemo 5
    platform, select \gui {Help > Index} and look for \gui {Platform Notes},
    or see
    \l{http://doc.qt.nokia.com/qt-maemo-4.6/platform-notes.html}{Platform Notes - Maemo 5}.
Leena Miettinen's avatar
Leena Miettinen committed
    \section1 Hardware and Software Requirements
Leena Miettinen's avatar
Leena Miettinen committed
    To build and run Qt applications for Maemo, you need the following:
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \list
       \o  Nokia N900 device with software update release 1.2 (V10.2010.19-1)
       or later installed.
       \o  MADDE cross-platform Maemo development
           tool (installed as part of the Nokia Qt SDK).

           For more information about MADDE pertaining to its
           installation, configuration, and deployment on the device, see
          \l{http://wiki.maemo.org/MADDE}{Introduction to MADDE}.
       Only needed if you develop on Windows and if you use a USB connection
       to run applications on the device. The drivers are
       installed as part of the Nokia Qt SDK. You can also download them from
       \l{https://garage.maemo.org/frs/?group_id=801&release_id=2655}{PC Connectivity}
       on the Maemo web site. Download and install the latest
       PC_Connectivity_<version>.exe (at the time of writing,
       PC_Connectivity_0.9.4.exe).
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

    \endlist

     The Qt Creator/MADDE integration is supported on the following platforms:
    \list
       \o  Linux (32 bit and 64 bit)
       \o  Windows (32 bit and 64 bit)
Leena Miettinen's avatar
Leena Miettinen committed
       \omit \o  Mac OS 10.5 Leopard, or higher \endomit
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \endlist

Leena Miettinen's avatar
Leena Miettinen committed
    \note The only supported build system for Maemo in Qt
    \section1 Setting Up the Nokia N900
    You can connect your device to your development PC using either a USB or
    WLAN connection.

    For the device, you need to use a tool called Mad Developer to create the
    device-side end point for USB and WLAN connections. It provides no
    diagnostics functions but is essential for creating connections between the
Leena Miettinen's avatar
Leena Miettinen committed
    device and your development PC.
    To use a WLAN connection, you must activate WLAN on the device and connect
    it to the same WLAN as the development PC. The network address is displayed
    in the Mad Developer.

    To use an USB connection, you need to set up the Nokia N900 as a network device
    on the development PC.
    \note If you plan to connect your development PC to the Nokia N900 only over WLAN, you can
    ignore the USB-specific parts in the following sections.
    \section2 Installing and Configuring Mad Developer
    Install Mad Developer on a device and configure
    a connection between the development PC and the device.

    To install and configure Mad Developer:

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
     \list 1
         \o On the Nokia N900, select \gui{Download} > \gui{Development} > \gui{mad-developer}
         to install the Mad Developer software package.
         \o Click \gui {Mad Developer} to start the Mad Developer application.
         \o To use a WLAN connection, activate WLAN on the device and connect
         to the same network as the development PC. You can see the network
         address in the \gui wlan0 field.

         \o To use an USB connection:
         \list a

         \o If you are using Microsoft Windows as development host, you must
         change the driver loaded for instantiating the connection.
         In the Mad Developer, select \gui{Manage USB} and select \gui{Load g_ether}.
         \o To set up the USB settings, click \gui Edit on the \gui usb0 row and
         confirm by clicking \gui Configure.
          \note By default, you do not need to make changes. The \gui usb0 row
       \o Select \gui{Developer Password} to generate a password for a freshly
          created user called \bold developer. The password stays valid for as long
          as the password generation dialog is open. You enter the password when
          you configure the connection in Qt Creator.
          \image qtcreator-mad-developer-screenshot.png
    \endlist
    \section1 Installing Qt Mobility APIs

    To develop applications that use the Qt Mobility APIs, you must install the
    APIs on the devices. The APIs are not available in the Nokia N900 package
    manager, and therefore, you must install them from the command line as the
    root user. To become the root user you must first install \c rootsh from the
    application manager.

    \list 1

        \o On the device, install \c rootsh from the \gui {Application Manager}.

        \o In \gui Programs, select \c {X Terminal} to open a terminal window.

        \o To switch to the root user, enter the following command:
        \c{sudo gainroot}

        \o To install Qt Mobility libraries, enter the following command:
        \c{apt-get install libqtm-*}

        \o To confirm the installation, enter: \c Y
    \section1 Setting Up Network Connectivity on Development PC
    Use the network configuration tools on your platform to specify the
    connection to the device on the development PC. You need to do this
    only if you use an USB connection.
    The device uses the IP address 192.168.2.15 with the subnet 255.255.255.0
    for its USB connection by default, so you can create the network interface
    with a different address inside the same subnet too.

    \note If you have changed the IP address of the device when configuring
Leena Miettinen's avatar
Leena Miettinen committed
    Mad Developer, you need to reflect those changes in your development PC USB
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    Run the following command in a shell as root user:
                  \c{ifconfig usb0 192.168.2.14 up}

    When you connect the device to your Windows PC, Windows tries to install a
    driver for the Linux USB Ethernet connection. In the
    \gui{Found New Hardware Wizard}, select \gui{No, not this time} in the
    first dialog and \gui{Install the software automatically} in the second
    dialog.

    To specify a network connection:

    \list 1

    \o Open the Network Connections window.
    \o Select the Linux USB Ethernet
    connection that is displayed as a new Local Area Connection.
    \o Edit the \gui {Internet Protocol Version 4 (TCP/IPv4)} properties
    to specify the IP address for the connection.
    In the \gui {Use the following IP address} field, enter the following values:
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \list
       \o  \gui {IP Address}: \bold {192.168.2.14}
       \o  \gui SubnetMask: \bold {255.255.255.0}
       \o  \gui {Default gateway}: leave this field empty
    \endlist

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \endlist

    your version of Microsoft Windows you may have to unplug and re-plug the
    Nokia N900 to reload the driver with its configuration accordingly.
Leena Miettinen's avatar
Leena Miettinen committed
    If you install Nokia Qt SDK, the MADDE package is installed and
    configured automatically on your development PC and you can omit this task.
Leena Miettinen's avatar
Leena Miettinen committed

    \list 1

    \o Download the MADDE installer file for your platform from the
    \l{http://wiki.maemo.org/MADDE}{MADDE} site.

    \o Execute the installer and follow the instructions.

    \o To see which targets are available, run \c{mad-admin list targets}.

    \o To install the target that starts with the string \bold fremantle, use the command:
    \c{mad-admin create fremantle-qt-xxx}
    \o In Qt Creator, register the MADDE tool chain:

       \image qtcreator-screenshot-toolchain.png

        \list a

            \o Select \gui Tools > \gui Options... > \gui Qt4 > \gui{Qt Versions}.

            \o Click \inlineimage qtcreator-windows-add.png,
            to add a new Qt version.

            The \gui{qmake Location} is the qmake
            executable in \c{<MADDE dir>/targets/<fremantle target>/bin}.

        \endlist

    \endlist

    When you have installed the target, you have a toolchain and a sysroot
    environment for cross-compiling.
    \section1 Configuring Connections in Qt Creator

    To be able to run and debug applications on the Maemo emulator and
    devices, you must set up a connection to the emulator and the device in the
    Qt Creator build and run settings. If you install Nokia Qt SDK, the
    necessary software is installed and configured automatically and you
    only need to configure a connection to the device.

    By default, you create the connection as the \e developer user. This
    protects real user data on the device from getting corrupted during
    testing. If you write applications that use Mobility APIs, you might want
    to test them with real user data. To create a connection as a user, specify
    the \gui Username and \gui Password in Qt Creator. For more information, see
    \l{Testing with User Data}.

    You can protect the connections between Qt Creator and the Maemo emulator
    or a device by using either a password or an SSH key. You must always
    use a password for the initial connection, but can then deploy an SSH
    key and use it for subsequent connections. If you use a password, you
    must generate it in Mad Developer and enter it in Qt Creator every time
    you connect to the Maemo emulator or to a device.
    If you do not have an SSH key, you can create it in Qt Creator.
    Encrypted keys are not supported. For more
    information, see \l{Generating SSH Keys}.

    To configure connections between Qt Creator and the Maemo emulator or
    device:

        \o If you install the Maemo emulator (QEMU) separately, you must
           specify parameters to access it:
Leena Miettinen's avatar
Leena Miettinen committed

            \list a
            \o Start Mad Developer in the emulator.
Leena Miettinen's avatar
Leena Miettinen committed

            \o Click \gui {Developer Password} to generate a password for
            the connection.
Leena Miettinen's avatar
Leena Miettinen committed

            \o In Qt Creator, select \gui {Tools > Options... > Projects >
            Maemo Device Configurations > Add} to add a new configuration.

            \image qtcreator-maemo-emulator-connection.png

            \o In the \gui {Configuration name} field, enter a name for
            the connection.

            \o In the \gui {Device type} field, select \gui {Maemo emulator}.

            \o In the \gui {Authentication type} field, select \gui Password
            for the initial connection.

            \o In the \gui Password field, enter the password from the Mad
            Developer for the initial connection.

            You can use the default values for the other fields.
            \o Click \gui Test to test the connection.

            \o To avoid having to specify the password every time you connect
            to the Maemo emulator, click \gui {Deploy Key...} and select
            the file that contains your public key.

            \o When you have deployed the key to the device, change the
            configuration to use the SSH key for protection.

            \image qtcreator-maemo-emulator-connection-key.png

            The default location of the private key file is displayed in the
            \gui {Private key file} field.
Leena Miettinen's avatar
Leena Miettinen committed
            \endlist

            If you installed the Nokia Qt SDK, a connection has been configured
            and you only need to specify the password and deploy the SSH key.
Leena Miettinen's avatar
Leena Miettinen committed
        \o  To deploy applications and run them remotely, specify parameters
            for accessing devices:
Leena Miettinen's avatar
Leena Miettinen committed
            \list a
            \o Connect your device to the development PC via an USB cable or
            a WLAN. For an USB connection, you are prompted to select the mode
            to use. Choose \gui{PC suite mode}.
            \note If you experience connection problems due to a USB port issue,
            switch to a different port or use WLAN to connect to the device.
            \o Select \gui Tools > \gui Options... > \gui Projects >
            \gui{Maemo Device Configurations > Add}, and add a new configuration for a
            \gui {Remote device}.
            \image qtcreator-screenshot-devconf.png

            \o In the \gui {Host name} field, enter the IP address from the
            \gui usb0 or \gui wlan0 field in Mad Developer.
Leena Miettinen's avatar
Leena Miettinen committed

            \o Specify the other settings in the same way as for a Maemo emulator
            connection.
Leena Miettinen's avatar
Leena Miettinen committed

            \o Click \gui Test to test the connection.
Leena Miettinen's avatar
Leena Miettinen committed
            \o Click \gui OK to close the dialog.
Leena Miettinen's avatar
Leena Miettinen committed
            \endlist
         \o To specify build and run settings:
Leena Miettinen's avatar
Leena Miettinen committed
            \list a
Leena Miettinen's avatar
Leena Miettinen committed
                \o Open a project for an application you want to develop for your
Leena Miettinen's avatar
Leena Miettinen committed
                \o Click \gui Projects to open the projects mode.
Leena Miettinen's avatar
Leena Miettinen committed
                \o In the \gui{Build Settings} section, choose the MADDE Qt version.
Leena Miettinen's avatar
Leena Miettinen committed
                 \image qtcreator-screenshot-build-settings.png
Leena Miettinen's avatar
Leena Miettinen committed
                 \o In the \gui{Run Settings} section, click \gui Add to add a new
Leena Miettinen's avatar
Leena Miettinen committed
                 \o Set a name and select the device configuration.
Leena Miettinen's avatar
Leena Miettinen committed
                 \image qtcreator-screenshot-run-settings.png

                 \note You can either add separate run settings for both the Maemo
                  emulator connection and the device connection or select the
                  \gui {Device configuration} before you run the application.

Leena Miettinen's avatar
Leena Miettinen committed
             \endlist

         \endlist
    \section2 Testing with User Data

    To run your application as the default user, you must first assign a password
    for the user account and then create the connection to the device as the
    user:

    \list 1

        \o On the device, in \gui Programs, select \c {X Terminal} to open a
        terminal window.

        \o To switch to the root user, enter the following command:
        \c{sudo gainroot}

        \o To specify the password, enter the following command:
        \c {passwd user}

        \o In Qt Creator, Select \gui Tools > \gui Options... > \gui Projects >
        \gui{Maemo Device Configurations}.

        \o Specify the username \c user and the password in the device configuration.

    \endlist

         \section2 Generating SSH Keys

         If you do not have an SSH public and private key pair, you can generate it
         in Qt Creator. You can specify key length and the key algorithm, RSA or DSA.
         If you only use the keys to protect connections to the Maemo emulator or
         device, you can use the default values.

         \list 1

             \o Select \gui {Tools > Options... > Projects > Maemo Device Configurations
             > Generate SSH Key...}.

             \o Click \gui {Generate SSH Key}.

             \image qtcreator-ssh-key-configuration.png "SSH Key Configuration dialog"

             \o Click \gui {Save Public Key...} to select the location to save the
             public key.

             \o Click \gui {Save Private Key...} to specify the location to save the
             private key.

             \o Click \gui Close to close the dialog.

         \endlist

    The addresses used in this example might be reserved by some other application
    in your network. If you cannot establish a connection, try the following optional
    configurations:

    \table

        \header
            \o usb0 in Mad Developer on Device
            \o USB Network on Development PC
            \o Host Name in Qt Creator Build Settings

        \row
            \o 172.30.7.15 255.255.255.0
            \o 172.30.7.14 255.255.255.0
            \o 172.30.7.15

        \row
            \o 10.133.133.15
            \o 10.133.133.14
            \o 10.133.133.15

        \row
            \o 192.168.133.15
            \o 192.168.133.14
            \o 192.168.133.15

            \note You cannot use the value localhost for connections to a device.

        \endtable

    \note VPN connections might block the device connection.

    \previouspage creator-debugging-helpers.html
    \nextpage creator-version-control.html

    \title Using the Maemo Emulator

    The Maemo emulator emulates the Nokia N900 device environment. You can test
    applications in conditions practically identical to running the application
    on a Nokia N900 device with software update release 1.2 (V10.2010.19-1).
    You can test user interaction by using the keypad and
    touch emulation.

    To test the application UI, user interaction with the application, and
    functionality that uses the mobility APIs, use the Qt Simulator,
    instead. For more information, see the
    \l{http://doc.qt.nokia.com/qt-simulator-beta/index.html}{Qt Simulator Manual}.

    The Maemo emulator is installed and configured as part of the Nokia Qt SDK
    package. You can also install and configure the MADDE environment and
    Maemo emulator separately. For more information, see
    \l{Setting Up Development Environment for Maemo}.

    \section1 Starting the Maemo Emulator

    The \gui {Start Maemo Emulator} button is visible if you have a project
    open in Qt Creator for which you have added the Maemo build target
    and if you have configured a connection between Qt Creator and the Maemo
    Emulator.

    To start the Maemo emulator:

    \list 1

    \o Click
    \inlineimage qtcreator-maemo-emulator-button.png "Start Maemo Emulator button"
    .

    \o Select \gui {Mad Developer} on the Maemo emulator, to start the Mad Developer
    application

    \o If you have not deployed an SSH key to protect the connection between
    Qt Creator and the Maemo emulator, select \gui {Developer Password} to generate
    a password.

    \o In Qt Creator, enter the password in the connection settings:
    \gui {Tools > Options... > Projects > Maemo Device Configurations}.

    \endlist

    Test your application on the Maemo emulator as on a device. For a list of
    keyboard shortcuts that you can use to emulate Nokia N900 keys and functions, see
    \l {Emulating Nokia N900 Keys}.

    \section1 Emulating Nokia N900 Keys

    The following table summarizes the keyboard shortcuts that you can use
    to emulate Nokia N900 keys and functions.

    \table
        \header
            \o Nokia N900 Key
            \o Keyboard Shortcut
        \row
            \o \list
                \o Alphabet keys
                \o Comma (,)
                \o Period (.)
                \o Space
                \o Arrow keys
                \o Enter
                \o Backspace
               \endlist
            \o Respective keys on the development PC keyboard.
        \row
            \o Shift
            \o Left Shift key
        \row
            \o Ctrl
            \o Left Ctrl key
        \row
            \o Mode
            \o Left Alt key
        \row
            \o Power
            \o Esc
        \row
            \o Keypad slider open and close
            \o F1
        \row
            \o Keypad lock
            \o F2
        \row
            \o Camera lens open and close
            \o F3
        \row
            \o Camera focus
            \o F4
        \row
            \o Camera take picture
            \o F5
            \note The actual camera functionality is not emulated.
        \row
            \o Stereo headphones connect and disconnect
            \o F6
        \row
            \o Volume down
            \o F7
        \row
            \o Volume up
            \o F8
        \row
            \o Accelerometer x axis, negative
            \o 1
        \row
            \o Accelerometer x axis, positive
            \o 2
        \row
            \o Accelerometer z axis, negative
            \o 4
        \row
            \o Accelerometer z axis, positive
            \o 5
        \row
            \o Accelerometer y axis, negative
            \o 7
        \row
            \o Accelerometer y axis, positive
            \o 8

    \endtable


*/

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

/*!
    \contentspage index.html
    \previouspage creator-developing-maemo.html
    \page creator-developing-symbian.html
    \nextpage creator-project-managing-sessions.html
Leena Miettinen's avatar
Leena Miettinen committed

    \title Setting Up Development Environment for Symbian

    For more information about developing applications for the Symbian
    platform, select \gui {Help > Index} and look for \gui {Platform Notes},
    or see
    \l{http://doc.qt.nokia.com/4.6/platform-notes-symbian.html}{Platform Notes - Symbian}.

Leena Miettinen's avatar
Leena Miettinen committed
    \section1 Hardware and Software Requirements

    Windows is the only development platform for the Symbian target
    supported at the moment.
Leena Miettinen's avatar
Leena Miettinen committed
    For deploying and running applications on the device, you need the
    following:
    \list
        \o The Nokia USB drivers that come with \e{PC Suite} or \e{Ovi Suite}
        \o The \l{http://tools.ext.nokia.com/trk/}{App TRK} application for
           your device
        \o The \e{qt_installer.sis} package installed on the device, that is
         delivered with the Qt SDK
         \o \e {Qt Mobility APIs} installed on the device, if you use them in
         applications
Leena Miettinen's avatar
Leena Miettinen committed
    \endlist

    To run your applications in the Symbian emulator, you also need
    to install Carbide.c++ v2.0.0 or higher.
    \section1 Installing Required Applications on Devices

    The Nokia Qt SDK installation program creates shortcuts for installing
    the required applications on Symbian devices (you can also use any of
    the standard methods for installing applications on devices):

    \list 1