Skip to content
Snippets Groups Projects
qtcreator.qdoc 198 KiB
Newer Older
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    Code refactoring is the process of changing the code without modifying the
    existing functionality of your application. By refactoring your code you
    can:
    \list
        \o Improve internal quality of your application
        \o Improve performance and extensibility
        \o Improve code readability and maintainability
        \o Simplify code structure
    \endlist
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 Finding Symbols
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    To find the use of a specific symbol in your project:
    \list 1
        \o In the editor place the cursor on the symbol and select \gui Tools
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
           \key Ctrl+Shift+U.

           Qt Creator looks for the symbol in the following locations:
           \list
            \o Files listed as a part of the project
            \o Files directly used by the project files (for example, generated
               files)
            \o Header files of used frameworks and libraries
           \endlist
        \o The \gui{Search Results} pane opens and shows the location and
           number of instances of the symbol in the current project.

           \image qtcreator-refactoring-find.png
    \endlist
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    You can browse the search results in the following ways:
    \list
        \o To go directly to an instance, double-click the instance in the
           \gui{Search Results} pane.
        \o To move between instances, click
           \inlineimage qtcreator-forward.png
           and
           \inlineimage qtcreator-back.png
           in the \gui{Search Results} pane.
        \o To expand and collapse the list of all instances, click
           \inlineimage qtcreator-expand.png
           .
        \o To clear the search results, click \inlineimage qtcreator-clear.png
           .
    \endlist
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 Renaming Symbols

    To rename a specific symbol in your project:
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \list 1
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
        \o In the editor, place the cursor on the symbol you would like to
           change and select \gui Tools > \gui C++ >
           \gui{Rename Symbol Under Cursor} or press \key Ctrl+Shift+R.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

           The \gui{Search Results} pane opens and shows the location and
           number of instances of the symbol in the current project.

           \image qtcreator-refactoring-replace.png
        \o To replace all selected instances, enter the name of the new symbol
           in the \gui{Replace with} text box and click \gui Replace.

           To omit an instance, uncheck the check-box next to the instance.

           \note This action replaces all selected instances of the symbol in
           all files listed in the \gui{Search Results} pane. You cannot
           undo this action.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \endlist
    \note Renaming local symbols does not open the \gui{Search Results} pane.
    The instances of the symbol are highlighted in code and you can edit the
    symbol. All instances of the local symbol are changed as you type.
*/
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \previouspage creator-editor-locator.html
    \page creator-project-managing.html
    \nextpage creator-project-creating.html

    \title Managing Projects
con's avatar
con committed

    One of the major advantages of Qt Creator is that it allows a team of
    developers to share a project across different development platforms with a common
    tool for development and debugging.

    The recommended way to build a project is to use a \l{Using Version Control Systems} {version control system}.
    Store and edit only project source files and the .pro and .pri files (for qmake)
    or CMakeLists.txt and *.cmake files (for CMake). Do not store
    files generated by the build system or Qt Creator, such as makefiles,
    .pro.user, and object files. Other approaches are possible,
    but we recommend that you do not use network resources, for example.

    Qt Creator allows you to specify separate \l{Build Settings} {build settings}
    for each development platform. By default, \l{glossary-shadow-build}{shadow builds} are used to
    keep the build specific files separate from the source.

    You can create separate versions of project files to keep platform-dependent
    code separate. You can use qmake
    \l{http://qt.nokia.com/doc/4.2/qmake-tutorial.html#adding-platform-specific-source-files}{scopes}
    to select the file to process depending on which platform qmake is run on.

    Items such as open files, breakpoints, and watches are stored in
    \l{Managing Sessions}{sessions}. They are not considered to be part of the
    information shared across platforms.

    Qt Creator is integrated with cross-platform systems for build automation:
    qmake and CMake. In addition, you can import generic projects that do not use qmake
    or CMake, and specify that Qt Creator ignores your build system.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \list
       \o To work with \bold{qmake projects}, open a \c .pro file. For more
          information, see \l{Setting Up a qmake Project}.
       \o To work with \bold{CMake projects} you need to have CMake version
          2.8.0 or later installed. For more information, see
          \l{Setting Up a CMake Project}.
       \o To work with \bold{generic projects}, specify which files belong to
          your project and which include directories or defines you want to pass
          to your compiler. For more information, see
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
          \l{Setting Up a Generic Project}.
    \endlist
con's avatar
con committed

    To change the location of the project directory, and to make changes in
    the build and run settings, select \gui{Tools} > \gui{Options...} >
    \gui{Projects} > \gui{General}.

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 External Libraries
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    Through external libraries Qt Creator can support code completion and
    syntax highlighting for external libraries as if they were a part of the
    current project or the Qt library.
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    The procedure of adding a library to a project depends on the type of
    project, which influences the build system used.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \list
       \o For information on adding external libraries to qmake projects, see
          \l{Adding External Libraries to a qmake Project}.
       \o For information on adding external libraries to CMake projects, see
          \l{Adding External Libraries to a CMake Project}.
   \endlist

*/
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
/*!
    \contentspage index.html
    \previouspage creator-project-managing.html
    \page creator-project-creating.html
    \nextpage creator-project-qmake.html
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \title Creating a Project
    You use wizards to create and import several types of projects and files, such
    as Qt GUI or console applications and Qt Quick applications. You can also use
    wizards to add individual files to your projects. For example, you can create
    the following types of files:

    \list

        \o Qt resource files, which allow you to store binary files in the
        application executable

        \o \QD forms and Qt QML files, which specify parts of application user
        interfaces

        \o C++ class, source, or header files

    \endlist

    The wizards prompt you to enter the settings needed
    for that particular type of project and create the necessary files for you.

    \image qtcreator-new-project.png

    \section1 Using Project Wizards

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    To create a new project:
    \list 1
        \o Select \gui File > \gui{New File or Project} and select the type of your
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
           project.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

           The contents of the following dialogs depend on the project type.
           Follow the instructions of the wizard.
           This example uses \gui {Qt Gui Application}.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
        \o Name the project and set its path. To select the path from a
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
           Avoid using spaces and special characters in the project name and
           path.

           \image qtcreator-intro-and-location.png
        \o Specify the name of the class you want to create and using the
           drop-down menu select its base class type.

           Note that the \gui{Header file}, \gui{Source file} and
           \gui{Form file} fields are automatically updated as you name your
           class.

           \image qtcreator-class-info.png
        \o Review the project settings.

           To create the project, click \gui Finish.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

           \image qtcreator-new-project-summary.png
    \endlist
    \section1 Adding New Project Wizards

    If you have a team working on a large application or several applications,
    you might want to standardize the way the team members create projects
    and classes.

    You can use the wizard templates in the \c {share/qtcreator/templates/wizards}
    folder to create your own project and class wizards. Qt Creator looks in the
    folder and adds all wizards defined in wizard.xml files to the \gui New dialog
    that opens when you select \gui {File > New File or Project}.

    In a project wizard, you can specify the files needed in a project.
    You can add wizard pages to allow developers to specify settings for the
    projcet.

    In a class wizard, you can allow developers to specify the class name, base
    class, and header and source files for the class.

    To see how this works, rename wizard_example.xml as wizard.xml in the helloworld
    and listmodels folders. After you restart Qt Creator, the \gui {Custom Classes}
    and \gui {Custom Projects} categories appear in the \gui New dialog.

    \image qtcreator-custom-project-wizards.png "The New dialog with custom projects and classes"

    \section2 Creating Project Wizards

    To create a project wizard:

    \list 1

        \o Make a copy of the \c {share/qtcreator/templates/wizards/helloworld} or
        \c {share/qtcreator/templates/wizards/listmodel} folder.

        \o Modify the wizard_example.xml file.

        \o The following code determines the type of the wizard and its place
        in the \gui New dialog:

        \code

        <wizard version="1" kind="project"
        class="qt4project" firstpage="10"
        id="A.HelloWorld" category="B.CustomProjects">

        \endcode

        \list

            \o \c version is the version of the file contents. Do not modify this value.

            \o \c kind specifies the type of the wizard: \c project or \c class.

            \o \c class specifies the type of the project. Currently the only available
            type is \c qt4project, which specifies a Qt console project.

            \o \c firstpage specifies the place of the new page in the standard project
            wizard. The value 10 ensures that the custom page appears after the standard
            pages, as the last page of the wizard.

            \o \c id is the unique identifier for your wizard. The letter specifies the
            position of the wizard within the \c category. The HelloWorld wizard appears
            as the first wizard in the second category in the \gui New dialog.

            \o \c category is the category in which to place the wizard in the list.
            The letter specifies the position of the category in the list in the \gui New
            dialog.

        \endlist

        \o The following code specifies the icon and text that appear in the \gui New
         dialog:

        \code

        <icon>console.png</icon>
        <description>Creates a hello-world-project with custom message.</description>
        <description xml:lang="de">Erzeugt ein Hello-Welt-Projekt mit einer Nachricht.</description>
        <displayName>Hello World</displayName>;
        <displayName xml:lang="de">Hallo Welt</displayName>;
        <displayCategory>Custom Projects</displayCategory>
        <displayCategory xml:lang="de">Benutzerdefinierte Projekte</displayCategory>

        \endcode

        \list


            \o \c icon appears next to the \c displayName.

            \o \c description appears at the bottom of the \gui New dialog when you
            select the display name.

            \o \c displayName appears in the \gui New dialog, under the
            \c displayCategory.

            You can add translations as values for the text elements. Specify the target
            language as an attribute for the element. Use locale names (QLocale).
            For example, \c {xml:lang="de"}.

        \endlist

        \o The following code specifies the files to add to the project:

        \code

        <files>
            <file source="main.cpp"/>
            <file source="project.pro" target="%ProjectName%.pro"/>

        \endcode

        \list

            \o \c source specifies the file to copy to the project. The files must be
            located in the wizard folder.

            \o \c target specifies the new filename for the file. The \c {%ProjectName%}
            variable is replaced with the string that users specify in the \gui Name
            field on the first page of the wizard.

        \endlist

        \o The following code creates a page that specifies settings for the project:

        \code

        <!-- Create a 2nd wizard page with parameters -->
        <fieldpagetitle>Hello World Parameters</fieldpagetitle>
        <fieldpagetitle xml:lang="de">Hallo Welt Parameter</fieldpagetitle>
        <fields>
            <field mandatory="true" name="MESSAGE">
                <fieldcontrol class="QLineEdit" validator='^[^"]+$'  defaulttext="Hello world!" />
                <fielddescription>Hello world message:</fielddescription>
                <fielddescription xml:lang="de">Hallo-Welt-Nachricht:</fielddescription>
            </field>
        </fields>

        \endcode

        \list

            \o \c fieldpagetitle specifies the title of the page.

            \o \c field specifies whether the field is mandatory (\c true or \c false).
            You can use the value of the \c name field as a variable in other files (for
            example, \c {%MESSAGE%}.

            \o \c fieldcontrol specifies the field. \c class specifies the field type.
            You can use interface objects from the QWidget class to create fields. This
            example uses QLineEdit to create an input field.

            \o \c validator specifies a regular expression to check the characters allowed in
            the field.

            \o \c defaulttext specifies text that appears in the field by default.

            \o \c fielddescription specifies the field name that appears on the wizard page.

         \endlist

    \endlist

    \section2 Creating Class Wizards

    The widget.xml file for a class wizard is very similar to that for a project
    wizard. The differences are discussed below.

    To create a class wizard:

    \list 1

        \o The following code specifies settings for the wizard:

        \code

        <wizard version="1" kind="class" id="A.ListModel" category="B.CustomClasses">

           <description>Creates a QAbstractListModel implementation.</description>
           <description xml:lang="de">Erzeugt eine Implementierung von QAbstractListModel.</description>

           <displayName>QAbstractListModel implementation</displayName>
           <displayName xml:lang="de">Implementierung von QAbstractListModel</displayName>

           <displayCategory>Custom Classes</displayCategory>
           <displayCategory xml:lang="de">Benutzerdefinierte Klassen</displayCategory>

        \endcode

        For more information about the elements and their values, see
        \l {Creating Project Wizards}.

        \o The following code specifies the files to add to the project:

        \code

        <files>
            <file source="listmodel.cpp" target="%ClassName:l%.%CppSourceSuffix%"/>
            <file source="listmodel.h" target="%ClassName:l%.%CppHeaderSuffix%"/>
        </files>

        \endcode

        Here, \c target contains the following variables that are used to construct
        the filename:

        \list

        \o \c {%ClassName:l%} is replaced with the value of the \c ClassName field.
        The modifier \c l converts the string to lower case, to observe Qt
        conventions.

        \o \c {%CppSourceSuffix%} is replaced by the default source suffix, which
        is defined in Qt Creator in \gui {Tools > Options > C++ > File Naming}.
        For example, if users enter \bold MyClass, the filename becomes myclass.cpp
        when the project is created.

        \o \c {%CppHeaderSuffix%} is replaced by the default header suffix, which
        is also defined in \gui {File Naming}. Here, the filename would
        become myclass.h.

        \endlist

        \o The following code creates a page that allows users to select the class
        name, base class, and header and source files for the class:

        \code

        <!-- Create parameter wizard page -->

        <fieldpagetitle>ListModel parameters</fieldpagetitle>
        <fieldpagetitle xml:lang="de">Parameter des ListModel</fieldpagetitle>
        <fields>
            <field name="ClassName">

                <fieldcontrol class="QLineEdit" validator="^[a-zA-Z0-9_]+$" defaulttext="MyListModel" />

                <fielddescription>Class name:</fielddescription>
                <fielddescription xml:lang="de">Klassenname:</fielddescription>
            </field>
            <field name="Datatype">

                <fieldcontrol class="QComboBox" combochoices="QString,int" defaultindex="0" />

                <fielddescription>Data type:</fielddescription>
                <fielddescription xml:lang="de">Datentyp:</fielddescription>
            </field>
        </fields>

        \endcode

        In addition to QLineEdit, QComboBox is used in the class wizard to create
        a field. \c combochoices specifies the options in the combobox and
        \c defaultindex specifies that QString is the default value.

    \endlist

con's avatar
con committed
*/

con's avatar
con committed
/*!
    \contentspage index.html
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \previouspage creator-project-creating.html
    \page creator-project-qmake.html
    \nextpage creator-project-cmake.html
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \title Setting Up a qmake Project
con's avatar
con committed

    The qmake tool helps simplify the build process for development projects
    across different platforms. qmake automates the generation of makefiles
    so that only a few lines of information are needed to create each makefile.
    qmake can be used for any software project, whether it is written in Qt or not.

    The qmake tool generates a makefile based on the information in a project
    file that is generated by Qt Creator. It can generate makefiles for MinGW,
    Microsoft Visual studio, and CSL ARM in Windows, and GNU Compiler Collection
    (GCC) in Linux and Mac OS X.

    For more information about qmake, see the
    \l{http://qt.nokia.com/doc/4.2/qmake-manual.html}{qmake Manual}.

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 Selecting the Qt Version

    Qt Creator allows you to have multiple versions of Qt installed on
    your computer and use different versions for each of your projects.
    If Qt Creator finds \bold qmake in the \c{PATH} environment variable, it uses
    that version. The \l{glossary-system-qt}{ qmake version of Qt} is referred
    to as \bold{Qt in PATH}. If you intend to use only one version of Qt and it
    is already in the \c{PATH} and correctly set up for command line use, you do
    not need to manually configure your Qt version.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

    \note By default, Qt Creator compiles projects with the
    \l{glossary-default-qt}{default Qt version}. For information on how to
    override this setting, see \l{Build Settings}.

    \section2 Windows

    To add a Qt version for \bold MinGW:
    \list 1
        \o Select \gui Tools > \gui Options... > \gui Qt4 >
           \gui{Qt Versions}.
        \o Click \inlineimage qtcreator-windows-add.png
           and enter the name of the version in \gui{Version Name} field.
        \o Enter the qmake binary path in the \gui{qmake Location}.
        \o Enter the MinGW installation path in the \gui{MinGW Directory}.

           \image qtcreator-qt4-qtversions-win-mingw.png
    \endlist

    To add a Qt version for a \bold{Microsoft Visual C++} compiler:
    \list 1
        \o Select \gui Tools > \gui Options... > \gui Qt4 >
           \gui{Qt Versions}.
        \o Qt Creator automatically sets the correct environment variables for
           compilation. Select the internal version number of the installed
           Microsoft Visual C++ tool chains using the \gui MSVC drop-down
           box:
           \list
               \o \bold 7.1 for Visual Studio 2003
               \o \bold 8.0 for Visual Studio 2005
               \o \bold 9.0 for Visual Studio 2008
           \endlist

           \note If you are using the
           \bold{Windows SDK for Windows Server 2008}, Qt Creator identifies
           it as version 9.0.

           \image qtcreator-qt4-qtversions-win-msvc.png
    \endlist

    If you are using \bold{Qt for Symbian} and your S60 SDK is registered
    with devices.exe, Qt Creator automatically detects the Qt version. To add a
    Qt for Symbian version:
    \list 1
        \o Select \gui Tools > \gui Options... > \gui Qt4 >
           \gui{Qt Versions}.
        \o Select the \gui{S60 SDK} you want the Qt Creator to use.

           \image qtcreator-qt4-qtversions-win-symbian.png
        \o To build an application for your device using GCCE, enter the path
           to the \bold{CSL ARM Toolchain} directory in
           \gui{CSL\\GCCE Directory}.

           You do not need to specify this path if the compiler is included in
           the \c{PATH} environment variable.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
        \o To build an application for the emulator (WINSCW toolchain), enter
           the path to your Carbide C++ installation directory in
           \gui{Carbide Directory}.

           \note You need to have Carbide C++ version 2.0 or later installed.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \endlist

    \section2 Compiling Projects With Linux
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    To compile a project in Qt Creator, Linux uses GNU Compiler Collection
    (GCC). Intel Compiler Collection (ICC) is supported as a drop-in
    replacement for GCC.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    To add a Qt version:
    \list 1
        \o Select \gui Tools > \gui Options... > \gui Qt4 >
           \gui{Qt Versions}.
        \o Click \inlineimage qtcreator-linux-add.png
           and enter the name of the version in \gui{Version Name}.
        \o Enter the path to the qmake binary in \gui{Path to qmake}.
    \endlist

    \section2 Compiling Projects With Mac OS X
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

    To compile a project in Qt Creator, Mac OS X uses GNU Compiler Collection
    (GCC), which is part of Xcode.

    To add a Qt version:
    \list 1
        \o Select \gui{Qt Creator} > \gui Preferences... > \gui{Qt Versions}.
        \o Click \inlineimage qtcreator-macosx-add.png
           and enter the name of the version in \gui{Version Name}.
        \o Enter the path to the qmake binary in \gui{Path to qmake}.

           \image qtcreator-qt4-qtversions.png
    \endlist


    \section1 Setting Up a Project

    To view and modify the settings for currently open projects, switch to the
    \gui Projects mode by pressing \key Ctrl+4.

    \image qtcreator-projectpane.png

    The project pane consists of the following tabs:
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \list
       \o Targets
       \o Editor Settings
       \o Dependencies
    \endlist

    Use the \gui Build and \gui Run buttons on *Desktop* to switch between
    the build and run settings for the active project.

    If you have multiple projects open in Qt Creator, use
    \gui{Select a Project} option at the top to navigate between different
    project edits.

    \section1 Build Settings

    Different build configurations allow you to quickly switch between
    different build settings. By default, Qt Creator creates \bold debug
    and \bold release build configurations. The \bold{debug} and \bold{release}
    build configurations both use the
    \l{glossary-default-qt}{default Qt version}.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

    \image qtcreator-ppbuildsettings.png

    \section2 Adding and Removing Build Configurations

    To add a new build configuration, click \gui Add and select the type of
    configuration you would like to add. You can add as many build
    configurations as you need.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed

    To delete the build configuration currently selected, click \gui Remove.

    \section2 Editing Build Configurations

    To edit a build configuration:
    \list 1
        \o Select the build configuration you want to edit in
           \gui{Edit Build Configuration}.
        \o In section \gui General, you can specify:
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
            \o The \l{glossary-project-qt}{Qt version} you want to use to
               build your project. For more information, see
               \l{Selecting the Qt version}.
            \o The toolchain required to build the project.
            \o By default, projects are built in a separate directory
               from the source directory, as \l{glossary-shadow-build}{shadow builds}.
               This keeps the files generated for each target platform separate.

               \note Shadow building is not supported by the Symbian build system.
               Also, shadow building on Windows is not supported for Maemo.
               If you only build for one target platform, you can deselect
               the \gui{Shadow Build} checkbox.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \endlist
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section2 Build Steps
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    The build system of Qt Creator is built on qmake and make. In
    \gui{Build Steps} you can change the settings for qmake and make. Qt
    Creator runs the make command using the Qt version defined for the current
    build configuration.
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section2 Clean Steps
con's avatar
con committed

    You can use the cleaning process to remove intermediate files. This process
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    might help you to fix obscure issues during the process of building a
    project.
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    You can define the cleaning steps for your builds in the \gui{Clean Steps}:
    \list
        \o To add a clean step using make or a custom process, click
           \gui{Add clean step} and select the type of step you want to add.

           By default, custom steps are disabled. Activate custom steps by
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
           checking the \gui{Enable Custom Process Step} check-box.
        \o To remove a clean step, click \gui{Remove clean step} and select the
           step you want to remove.
        \o To change the order of steps, click
           \inlineimage qtcreator-movestep.png
           .
    \endlist
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section2 Build Environment
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    You can specify the environment you want to use for building in the
    \bold{Build Environment} section. By default, the environment in which Qt
    Creator was started is used and modified to include the Qt version.
    Depending on the selected Qt version, Qt Creator automatically sets the
    necessary environment variables. You can edit existing environment
    variables or add, reset and unset new variables based on your project
    requirements.
con's avatar
con committed


Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 Run Settings
con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    Qt Creator automatically creates run configurations for your project.
    These run configurations derive their executable from the parsed .pro
    files. You can also create custom executable run configurations where you
    can set the executable to be run.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \image qtcreator-pprunsettings.png
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \section1 File Encoding

    To define the default file encoding, select the desired encoding in the
    \gui{Editor Settings}. By default, the Qt Creator uses the file encoding
    used by your system.


    \section1 Dependencies

    If you have multiple projects loaded in your session, you can define the
    dependencies between them. Inter-project dependencies affect the build
    order of your projects.
    \note Inter-project dependencies are unrelated inside a qmake
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    project.

    To define the dependencies between projects:
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \list 1
        \o Select the project for which you want to configure dependencies.
        \o Check the checkboxes in the Dependencies section to select other
           projects as dependencies.
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \endlist


    \section1 Adding External Libraries to a qmake 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.

    To add an external library:
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
        \o Open your project file (.pro) using the \gui Projects pane.
        \o Follow the instructions at \l{http://doc.trolltech.com/latest/qmake-project-files.html#declaring-other-libraries}
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
           {Declaring other Libraries}.
    \endlist
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    Syntax completion and highlighting work once your project successfully
    builds and links against the external library.
con's avatar
con committed
*/

con's avatar
con committed
/*!
    \contentspage index.html
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \previouspage creator-quick-tour.html
    \page creator-getting-started.html
    \nextpage creator-writing-program.html

    \title Getting Started

    This section contains examples that illustrate how to use Qt Creator and the
    integrated design tools, \QD and \QMLD, to create simple applications:

    \list
        \o \l{Creating a Qt C++ Application}
        \o \l{Creating a Qt Quick Application}
    \endlist

*/


/*!
    \contentspage index.html
    \previouspage creator-writing-program.html
    \page creator-qml-application.html
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \nextpage creator-editor-using.html
con's avatar
con committed

    \note This tutorial assumes that you are familiar with the \l {http://qt.nokia.com/doc/4.7-snapshot/declarativeui.html}
    {QML declarative language}.

    This tutorial describes how to use Qt Creator to create a small animated

    \image qmldesigner-helloworld.png "Hello World"

    \section1 Creating the Hello World Project

    \note Create the project with the \gui{Help} mode active so that you can follow
    these instructions while you work.

    \list 1

        \o Select \gui{File > New File or Project > Qt Quick Project > Qt QML Application > OK}.

        \image qmldesigner-new-project.png "New File or Project dialog"

        The \gui{Introduction and Project Location} dialog opens.

        \image qmldesigner-new-project-location.png "Introduction and Project Location dialog"

        \o In the \gui{Name} field, type \bold {Hello World}.

        \o In the \gui {Create in} field, enter the path for the project files. For example,
        \c {C:\Qt\examples}, and then click \gui{Next}.

        The \gui{Project Management} dialog opens.

        \image qmldesigner-new-project-summary.png "Project Management dialog"

        \o Review the project settings, and click \gui{Finish} to create the project.

    \endlist

    The HelloWorld project now contains the following files:

    \list
        \o HelloWorld.qmlproject
        \o HelloWorld.qml
    \endlist

    \image qmldesigner-new-project-contents.png "HelloWorld project contents"

    The .qmlproject file defines that all QML, JavaScript, and image files in
    the project folder belong to the project. The .qml file contains some example
    code that specifies the screen size (200x200) and a label that contains
    the text \bold {Hello World}.

    \section1 Designing the User Interface

    \list

        \o In the \gui{Edit} mode, double-click the HelloWorld.qml file in
         the \gui{Projects} pane to open it in the visual \QMLD editor.
        \o Click \gui{Edit} to edit the screen size in the code editor.
        To set the screen size to that of some Symbian devices in portrait
        mode, for example, change the \c width to \bold 240 and \c height to \bold 320.
        \image qmldesigner-helloworld-screen-size.png "Setting the screen size"

        \o Click \gui{Design} to design the UI in the visual editor.

        \o Drag and drop a \gui {Rectangle} from the \gui {Library} pane to the
        scene.

        \image qmldesigner-helloworld-widget-add.png "Add component to Hello World"
        \o Edit the \gui {Properties} of the component to turn it into a red ball:
            \o In the \gui {Colors} section, click the color picker to select a red
            color.

            \o In the \gui {Radius} field, use the slider to set the radius value
            to \bold 50.

            \image qmldesigner-helloworld-widget-edit.png "Edit the component"

        \endlist

        \o To create a blue ball, press \key {Ctrl+C} and \key {Ctrl+V} to copy
        and paste the red one, and then change its color to blue.

        \image qmldesigner-helloworld-base-state.png "Hello World first view"

        The first view of your application is now ready.

        \note You can use graphical design tools to create nice images and
        copy them to the projects folder to display them in the \gui {Library}
        pane in \gui {Resources}.

        \o In the \gui State pane, click the plus sign to add another view, or \e state
        to the application.

        \o Modify the state by dragging and dropping the widgets to switch their
        places.

        \image qmldesigner-helloworld-state1.png "Hello World second view"

    \endlist

    \section1 Animating the Scene

    Animate the scene so that the widgets appear to switch places
    on the screen.

    \list 1

        \o Click \gui {Edit} to open HelloWorld.qml in the code editor.

        \o Add the following code to create a transition:

        \code
            transitions: [
            Transition {
                NumberAnimation { properties: "x, y"; duration: 500 }
            }
        \endcode

        \note The code editor completes the code for you as you type.

        \o  Click the \inlineimage qtcreator-run.png
        button to check that the application can be built and run.

    \endlist

    \section1 Adding Interaction

    Add interaction to the scene to allow users to click on the screen to start
    the animation.

    \list 1

        \o Click \gui{Design} to open HelloWorld.qml in the visual editor.

        \o Drag and drop a \gui {Mouse Area} from the \gui {Library} to the scene.

        \o In the \gui {Properties} pane, \gui {Geometry} tab, click the
        \inlineimage qmldesigner-anchor-fill-screen.png
        button to make the mouse region cover the whole screen.

        \o In the code editor, use data binding to add a \c when statement to
        the states sections, as illustrated by the following code:

        \code

        states: [
            State {
                name: "State1"
                when: mousearea1.pressed
        \endcode

    \endlist

    \section1 Buiding and Running the Application

    \list 1

        \o Press \key {Ctrl+R} to build and run the application.

        \o Click the screen and keep the mouse button pressed down to run the
        animation.

    \endlist

    \note In the \gui {QML Viewer}, select \gui {Skin} and select a mobile device
    type to view the application as on a mobile device.

*/


/*!
    \contentspage index.html
    \previouspage creator-getting-started.html
    \page creator-writing-program.html
    \nextpage creator-qml-application.html

con's avatar
con committed

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    \note This tutorial assumes that you have experience in writing basic Qt
    applications, using \QD to design user interfaces and using the Qt
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
    Resource System.
con's avatar
con committed

    This tutorial describes how to use Qt Creator
    to create a small Qt application, Text Finder. It is a simplified version of the
    QtUiTools \l{http://doc.trolltech.com/uitools-textfinder.html}{Text Finder}
    example.
con's avatar
con committed

    \image qtcreator-textfinder-screenshot.png

    \section1 Setting Up Your Environment

    Qt Creator automatically detects whether the location of Qt is in your \c PATH variable.
    If you have installed several Qt versions, follow the
    instructions in \l{Selecting the Qt version} to set the Qt path.
con's avatar
con committed

    \section1 Creating the Text Finder Project
con's avatar
con committed

    \note Create the project with the \gui{Help} mode active so that you can follow
    these instructions while you work.

    \list 1

        \o Select \gui{File > New File or Project > Qt Application Project > Qt Gui
        Application > OK}.

           \image qtcreator-new-project.png "New File or Project dialog"
        The \gui{Introduction and Project Location} dialog opens.
        \image qtcreator-intro-and-location.png "Introduction and Project Location dialog"
        \o In the \gui{Name} field, type \bold {TextFinder}.


        \o In the \gui {Create in} field, enter the path for the project files. For example,
        \c {C:\Qt\examples}, and then click \gui{Next}.
        The \gui{Select Required Qt Versions} dialog opens.

        \image qtcreator-new-project-qt-versions.png "Select Required Qt Versions dialog"

        \o Click \gui{Next} to use the Qt version set in the path in your project.

        The \gui{Class Information} dialog opens.
con's avatar
con committed