Commit c78528dc authored by Leena Miettinen's avatar Leena Miettinen
Browse files

Doc: move projects mode topics to a separate folder

Change-Id: I031e1f488c4923baea0bddbd24da804f3bb01c95
Reviewed-on: http://codereview.qt-project.org/5611

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent 44c107c2
/****************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
/*!
\contentspage index.html
\previouspage creator-getting-started.html
\page creator-build-example-application.html
\nextpage creator-qml-application.html
\title Building and Running an Example Application
You can test that your installation is successful by opening an existing
example application project.
\list 1
\o On the \gui Welcome page, select the \gui {Show Examples and Demos}
check box, and then search for \gui {Toys: Clocks Example} in the
list of examples.
\image qtcreator-gs-build-example-open.png "Selecting an example"
\o Select targets for the project. Select at least Qt Simulator
and one of the mobile targets, Symbian Device, Maemo 5, or
MeeGo Harmattan, depending on the device you develop for.
\image qtcreator-gs-build-example-targets.png "Selecting targets"
\note You can add targets later in the \gui Projects mode.
\o To test the application in Qt Simulator, click the \gui {Target
Selector} and select \gui {Qt Simulator}.
\image {qtcreator-gs-build-example-select-qs.png} "Selecting Qt Simulator as target"
\o Click
\inlineimage{qtcreator-run.png}
to build the application and run it in Qt Simulator.
\o To see the compilation progress, press \key{Alt+4} to open the
\gui {Compile Output} pane.
The \gui Build progress bar on the toolbar turns green when the
project is successfully built. The application opens in
Qt Simulator.
\image {qt-simulator.png} "Qt Simulator"
\o Change the settings in the \gui Model view. For example, rotate the
device by clicking the \gui {Orientation} buttons or choose from the
various mobile device configurations in the \gui {Device} field. You
can also simulate various mobile functions and create your own
scripts.
\if defined(qcmanual)
\o To test the application on a Symbian device, check that the required
Qt libraries and a debugging agent are installed on the device. For
more information, see \l{Connecting Symbian Devices}.
\o Click the \gui {Target Selector} and select \gui {Symbian Device}.
\o Click \gui Run to build the application and run it on the Symbian
device.
\endif
\endlist
*/
/****************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
/*!
\contentspage index.html
\previouspage creator-usability.html
\page creator-building-running.html
\nextpage creator-building-targets.html
\title Building and Running Applications
\QC provides support for building, running, and deploying Qt applications
for different \l{glossary-development-target}{targets}.
You can set up the following configurations:
\list
\o \e {Build configuration}, which contains everything you need to
compile the sources into binaries.
\o \e {Deploy configuration}, which handles the packaging and copying
of the necessary files to a location you want to run the executable
at. The files can be copied to a location in the file system of the
development PC or a mobile device.
\o \e {Run configuration}, which starts the application in the location
where it was stored by the deploy configuration.
\endlist
By default, when you select the \gui Run function, \QC builds, deploys, and
runs the project. To specify the relationship between the release, build,
and deploy configurations, select \gui {Tools > Options > Project}. By
default, the \gui {Always build project before deploying it} and the
\gui {Always deploy project before running it} options are enabled.
Therefore, when you select the \gui Run function, \QC builds, deploys, and
runs the project.
\image qtcreator-project-options-deploy.png "Project General Options"
*/
/****************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
/*!
\contentspage index.html
\previouspage creator-building-running.html
\page creator-building-targets.html
\nextpage creator-running-targets.html
\title Building Applications for Multiple Targets
You can build applications for multiple \l{glossary-development-target}
{targets}. By default, when you run the application on a target, you
automatically build it for the target and deploy it to the target first.
However, you can also perform each operation separately.
To check that the application code can be compiled and linked for a target,
you can build the project. The build errors and warnings are displayed in
the \gui {Build Issues} output pane. More detailed information is displayed
in the \gui {Compile Output} pane.
To build an application:
\list 1
\o Select a target for the project.
\image qtcreator-target-selector.png "Target selector"
\o Choose \gui {Build > Build Project} or press \key {Ctrl+B}.
\endlist
For more information on the options you have, see
\l{Specifying Build Settings}.
\if defined(qcmanual)
\input symbian/creator-projects-building-symbian.qdocinc
\endif
*/
/****************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
/*!
\contentspage index.html
\previouspage creator-project-wizards.html
\page creator-project-cmake.html
\nextpage creator-project-generic.html
\title Setting Up a CMake Project
CMake is an alternative to qmake for automating the generation of build
configurations. It controls the software compilation process by using simple
configuration files, called \c{CMakeLists.txt} files. CMake generates native
build configurations and workspaces that you can use in the compiler
environment of your choice.
Since \QC 1.1, CMake configuration files are supported. Since \QC 1.3, the
Microsoft tool chain is supported if the CMake version is at least 2.8.
\section1 Setting the Path for CMake
You can set the path for the \c CMake executable in \gui{Tools} >
\gui{Options > Projects > CMake}.
\image qtcreator-cmakeexecutable.png
\note Before you open a \c CMake project, you must modify the \c{PATH}
environment variable to include the bin folders of \c mingw and \QC in
the \QSDK.
For instance, if the \QSDK is installed in \c {C:\SDK}, you would use the
following command to set the environment variables in the command line
prompt:
\code
set PATH=C:\sdk\mingw\bin;C:\sdk\qt\bin;
\endcode
Then start \QC by typing:
\code
C:\sdk\bin\qtcreator.exe
\endcode
\section1 Opening CMake Projects
To open a \c CMake project:
\list 1
\o Select \gui{File} > \gui{Open File or Project}.
\o Select the \c{CMakeLists.txt} file from your \c CMake project.
\endlist
A wizard guides you through the rest of the process.
\note If the \c CMake project does not have an in-place build, \QC
lets you specify the directory in which the project is built
(\l{glossary-shadow-build}{shadow build}).
\image qtcreator-cmake-import-wizard1.png
The screenshot below shows how you can specify command line arguments to
\c CMake for your project.
\image qtcreator-cmake-import-wizard2.png
Normally, there is no need to pass any command line arguments for projects
that are already built, as \c CMake caches that information.
\section1 Building CMake Projects
\QC builds \c CMake projects by running \c make, \c mingw32-make, or
\c nmake depending on your platform. The build errors and warnings are
parsed and displayed in the \gui{Build Issues} output pane.
By default, \QC builds the \bold{all} target. You can specify which
targets to build in \gui{Project} mode, under \gui{Build Settings}.
\image qtcreator-cmake-build-settings.png
\QC supports multiple build configurations. You can change the build
directory after the initial import.
\section1 Running CMake Projects
\QC automatically adds \gui{Run Configurations} for all targets specified
in the \c CMake project file.
For more information about known issues for the current version, see
\l{Known Issues}.
\section1 Adding External Libraries to CMake Projects
Through external libraries, \QC can support code completion and syntax
highlighting as if they were part of the current project or the Qt library.
\QC detects the external libraries using the \c FIND_PACKAGE()
macro. Some libraries come with the CMake installation. You can find those
in the \c {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
\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.
*/
/****************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
/*!
\contentspage index.html
\previouspage creator-project-managing.html
\page creator-project-creating.html
\nextpage creator-project-opening.html
\title Creating Projects
\image qtcreator-new-project.png
You can use wizards to create following types of projects:
\list
\o Qt Quick Project
Use QML elements or Qt Quick Components to define the user interface
and, optionally, C++ or JavaScript to define the application logic.
\if defined(qcmanual)
\o Qt Widget Project
Use \QD forms to define a Qt widget based user interface and C++ to
define the application logic
\endif
\o Other Project
\list
\o HTML5 based applications
\o Qt console applications
\o Shared or static C++ libraries
\o Qt unit tests
\if defined(qcmanual)
\o Qt Custom Designer Widgets
\endif
\o Subprojects
\endlist
\o Project from Version Control
Import a project from a supported version control system. For more
information on how version control systems are integrated in
\QC, see \l{Using Version Control Systems}.
\endlist
To create a new project, select \gui File > \gui{New File or Project} and
select the type of your project. The contents of the wizard dialogs depend
on the project type and the build targets that you select in the
\gui {Target Setup} dialog. Follow the instructions of the wizard.
For examples of creating different types of projects, see
\l{Getting Started}.
For more information about creating Qt Quick projects, see
\l {Creating Qt Quick Projects}.
To change the location of the project directory, and to specify settings
for building and running projects, select \gui{Tools} > \gui{Options} >
\gui{Projects} > \gui{General}.
To specify build and run settings for different target platforms, select
\gui Projects.
\section1 Adding Files to Projects
You can use wizards also to add individual files to your projects.
You can create the following types of files:
\list
\o Qt resource files, which allow you to store binary files in the
application executable
\if defined(qcmanual)
\o \QD forms and \QD form classes, which specify parts of user
interfaces in Qt widget based projects
\endif
\o QML files, which specify elements in Qt Quick projects
\o GLSL files that define fragment and vertex shaders in both Qt Quick
projects and Qt widget based projects
\o C++ class, source, or header files that you can use to write the
application logic in both Qt Quick projects and
\if defined(qcmanual)
Qt widget based projects
\endif
\o JavaScript files that you can use to write the application logic in
Qt Quick projects
\o Text files
\endlist
\section2 Creating C++ Classes
The \gui {C++ Class Wizard} allows you to create a C++ header and source
file for a new class that you can add to a C++ project. Specify the class
name, base class, and header and source files for the class.
The wizard supports namespaces. To use a namespace, enter a qualified
class name in the \gui {Class name} field. For example:
MyNamespace::MySubNamespace::MyClass.
\image qtcreator-cpp-class-wizard.png "Enter Class Name dialog"
The names of the header and source file are based on the class name. To
change the default suffix of a file, click \gui Configure.
You can create your own project and class wizards. For more information,
see \l{Adding New Custom Wizards}.
\section2 Creating OpenGL Fragment and Vertex Shaders
Qt provides support for integration with OpenGL implementations on all
platforms, which allows you to display hardware accelerated 3D graphics
alongside a more conventional user interface. For more information, see
\l{http://doc.qt.nokia.com/4.7/qtopengl.html}{QtOpenGL Module}.
You can use the QGLShader class to compile OpenGL shaders written in the
OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language
(GLSL/ES). QGLShader and QGLShaderProgram shelter you from the details of
compiling and linking vertex and fragment shaders.
You can use \QC code editor to write fragment and vertex shaders
in GLSL or GLSL/ES. The code editor provides syntax highlighting and code
completion for the files.
\image qtcreator-new-opengl-file.png "New OpenGL file wizard"
\section2 Displaying Additional File Types in Projects Pane
\QC determines whether to display files from the project folder
in the \gui Projects pane depending on the file type (.pro, .pri, .cpp,
.h, .qrc, and so on). To display other types of files, edit the
project file. Add filenames as values of the \c {OTHER_FILES} variable.
You can also use wildcards.
For example, the following code specifies that text files are displayed
in the \gui Projects pane:
\code
OTHER_FILES += *.txt
\endcode
This also makes the files available in the \gui Locator.
\section1 Adding Subprojects to Projects
When you create a new project, you can add it to another project as a
subproject in the \gui{Project Management} dialog. However, the root project
must specify that qmake uses the \c subdirs template to build the project.
To create a root project, select \gui {File > New File or Project >
Other Project > Subdirs Project > Choose}.
On the \gui Summary page, select \gui {Finish & Add Subproject} to create
the root project and to add another project, such as a C++ library.
The wizard creates a project file (.pro) that defines a \c subdirs template
and the subproject that you add as a value of the
\l{http://doc.qt.nokia.com/4.7/qmake-variable-reference.html#subdirs}
{SUBDIRS variable}. It also adds all the necessary files for the subproject.
To add more subprojects, right-click the project name in the \gui Projects
pane, and select \gui {New Subproject} in the context menu.
To remove subprojects, right-click the project name in the \gui Projects
pane, and select \gui {Remove Subproject} in the context menu.
To specify dependencies, use the \gui{Add Library} wizard. For more
information, see \l{Adding Libraries to Projects}.
*/
This diff is collapsed.
/****************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
/*!
\contentspage index.html
\previouspage creator-project-cmake.html
\page creator-project-generic.html
\nextpage creator-version-control.html
\title Setting Up a Generic Project
\QC supports generic projects, so you can import existing projects
that do not use qmake or CMake and \QC ignores your build system.
Generic project support allows you to use \QC 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}.
When you import a project, \QC 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 compiler:
\tt{.files}, \tt{.includes}, and \tt{.config}.
\section1 Importing a Generic Project
To import an existing generic project:
\list 1