Files
qt-creator/doc/src/overview/creator-overview.qdoc

365 lines
14 KiB
Plaintext
Raw Normal View History

/****************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@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 qt-info@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-overview.html
\nextpage creator-quick-tour.html
\title IDE Overview
\QC is an integrated development environment (IDE) that provides you with
tools to design and develop applications with the Qt application framework.
Qt is designed for developing applications and user interfaces once and
deploying them across several desktop and mobile operating systems. \QC
provides you with tools for accomplishing your tasks throughout the whole
application development life-cycle, from creating a project to deploying the
application on the target platforms.
\image qtcreator-overview.png "Overview"
\section1 Cross-platform Development
One of the major advantages of \QC 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 version control system.
Store and edit only project source files and build system configuration
files (for example, .pro and .pri files for qmake). Do not store files
generated by the build system or \QC, such as makefiles, .pro.user, and
object files. Other approaches are possible, but we recommend that you do
not use network resources, for example.
\QC allows you to specify separate 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.7/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 evaluated expressions are stored
in sessions. They are not considered to be part of the information shared
across platforms.
\section1 Creating Projects
But why do you need projects? To be able to build and run applications,
\QC needs the same information as a compiler would need. This information
is specified in the project build and run settings.
Creating a project allows you to:
\list
\o Group files together
\o Add custom build steps
\o Include forms and resource files
\o Specify settings for running applications
\endlist
Setting up a new project in \QC is aided by a wizard that guides you
step-by-step through the project creation process. In the first step, you
select the type of the project. Next, you select a location for the project
and specify settings for it.
\image qtcreator-new-qt-quick-project-wizard.png
When you have completed the steps, \QC automatically generates the project
with required headers, source files, user interface descriptions and project
files, as defined by the wizard.
For example, if you choose to create a Qt Quick application, \QC generates a
QML file that you can modify with the integrated \QMLD.
\section2 Adding Libraries
In addition to Qt libraries, you can link your application to other
libraries, such as system libraries or your own libraries. Further, your
own libraries might link to other libraries. To be able to compile your
project, you must add the libraries to your project. This also enables
code completion and syntax highlighting for the libraries.
The procedure of adding a library to a project depends on the build
system that you use.
\section2 Version Control Systems
\QC uses the version control system's command line clients to access your
repositories. The following version control systems are supported:
\list
\o Git
\o Subversion
\o Perforce
\o CVS
\o Mercurial
\o Bazaar
\endlist
The functions available to you in \QC depend on the version control system.
Basic functions are available for all the supported systems. They include
comparing files with the latest versions stored in the repository and
displaying the differences, viewing versioning history and change details,
annotating files, and committing and reverting changes.
\section1 Designing User Interfaces
\if defined(qcmanual)
\QC provides two integrated visual editors, \QMLD and \QD.
\image qtcreator-ui-designers.png "Qt Quick Designer and Qt Designer"
\endif
Large high-resolution screens, touch input, and significant graphics power
are becoming common in portable consumer devices, such as mobile
phones, media players, set-top boxes, and netbooks. To fully benefit from
these features and to create intuitive, modern-looking, fluid user
interfaces, you can use \l {http://doc.qt.nokia.com/4.7/qtquick.html}
{Qt Quick}.
Qt Quick consists of a rich set of user interface elements, a declarative
language for describing user interfaces, and a language runtime. A
collection of C++ APIs is used to integrate these high level features with
classic Qt applications.
You can edit QML code in the code editor or in the integrated \QMLD.
The integration includes project management and code completion.
\if defined(qcmanual)
If you need a traditional user interface that is clearly structured and
enforces a platform look and feel, you can use the integrated \QD. You can
compose and customize your widgets or dialogs and test them using different
styles and resolutions.
\endif
\section1 Code Editor
As an IDE, \QC differs from a text editor in that it knows how to build and
run applications. It understands the C++ and QML languages as code, not just
as plain text. This allows it to:
\list
\o Enable you to write well formatted code
\o Anticipate what you are going to write and complete the code
\o Display inline error and warning messages
\o Enable you to semantically navigate to classes, functions, and
symbols
\o Provide you with context-sensitive help on classes, functions, and
symbols
\o Rename symbols in an intelligent way, so that other symbols with the
same name that belong to other scopes are not renamed
\o Show you the locations in code where a function is declared or
called
\endlist
You can use the code editor to write code in Qt C++ or in the QML
declarative programming language. QML is an extension to JavaScript, that
provides a mechanism to declaratively build an object tree of QML elements.
QML improves the integration between JavaScript and Qt's existing QObject
based type system, adds support for automatic property bindings and provides
network transparency at the language level.
\section1 Building
\QC 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 \QC ignores your build system.
\if defined(qcmanual)
\QC provides support for building and running Qt applications for desktop
environment (Windows, Linux, and Mac OS) and mobile devices (Symbian, Maemo,
and MeeGo Harmattan). Build settings allow you to quickly switch between
build targets.
\endif
When you install tool chains for build targets as part of the \QSDK, the
build and run settings for mobile device targets are set up automatically.
However, you might need to install and configure some additional software on
the devices to be able to connect to them from the development PC.
\note The only supported build system for mobile applications in \QC is
qmake.
\section1 Testing
If you install \QC as part of \QSDK, the GNU Symbolic Debugger is installed
automatically and you should be ready to start debugging after you create a
new project. However, you can change the setup to use debugging tools for
Windows, for example. You can connect mobile devices to your development PC
and debug processes running on the devices.
You can use code analysis tools to detect memory leaks, profile cache usage,
and profile Qt Quick applications.
You can test applications that are intended for mobile devices in a
simulator or emulator, but you also need to test the applications on real
devices.
\section2 Debuggers
\QC is integrated to several external native debuggers:
\list
\o GNU Symbolic Debugger (GDB)
\o Microsoft Console Debugger (CDB)
\o internal JavaScript debugger
\endlist
You can use the \QC \gui Debug mode to inspect the state of your application
while debugging. You can interact with the debugger in several ways,
including the following:
\list
\o Go through a program line-by-line or instruction-by-instruction.
\o Interrupt running programs.
\o Set breakpoints.
\o Examine the contents of the call stack.
\o Examine and modify registers and memory contents of
the debugged program.
\o Examine and modify registers and memory contents of
local and global variables.
\o Examine the list of loaded shared libraries.
\o Create snapshots of the current state of the debugged program
and re-examine them later.
\endlist
\QC displays the raw information provided by the native debuggers in a clear
and concise manner with the goal to simplify the debugging process as much
as possible without losing the power of the native debuggers.
In addition to the generic IDE functionality provided by stack view, views
for locals and expressions, registers, and so on, \QC includes features to
make debugging Qt-based applications easy. The debugger plugin understands
the internal layout of several Qt classes, for example, QString, the Qt
containers, and most importantly QObject (and classes derived from it), as
well as most containers of the C++ Standard Library and some GCC extensions.
This deeper understanding is used to present objects of such classes in a
useful way.
\section3 QML Script Console
You can use the \QC \gui Debug mode to inspect the state of the application
while debugging JavaScript functions. You can set breakpoints, view call
stack trace, and examine locals and expressions.
When the application is interrupted by a breakpoint, you can use the
\gui {QML Script Console} to execute JavaScript expressions in the current
context. You can type JavaScript expressions and use them to get information
about the state of the application, such as property values.
If you change property values or add properties in the code editor, the
changes are updated in the running application when they are saved.
\section3 QML Inspector
While the application is running, you can use the \gui {QML Inspector} view
to explore the object structure, debug animations, and inspect colors. When
debugging complex applications, you can use the inspection mode to jump to
the position in code where an element is defined.
\section2 Code Analysis Tools
The memory available on devices is limited and you should use it carefully.
\QC integrates Valgrind code analysis tools for detecting memory
leaks and profiling function execution. These tools are only supported on
Linux and Mac OS, but you can run them remotely from Windows. You must
download and install them separately to use them from \QC.
The QML Profiler is installed as part of \QC. It allows you
to profile your Qt Quick applications and is available on all supported
development platforms.
\section2 Qt Simulator
You can use the Qt Simulator to test Qt applications that are intended
for mobile devices in an environment similar to that of the device. You
can change the information that the device has about its configuration
and environment.
Qt Simulator does not support any device specific APIs by design. Therefore,
applications that run well on Qt Simulator also run on any device that hosts
the Qt and Qt Mobility libraries. However, this means that you cannot use
Qt Simulator to test applications that use device specific libraries, such
as Symbian C++ APIs. To test such applications, use the device emulators or
real devices.
The Qt Simulator is installed as part of the \QSDK. After it is
installed, you can select it as a build target in \QC.
\if defined(qcmanual)
\input linux-mobile/madde-emulator-overview.qdocinc
\endif
\section1 Deploying
\QC deploy configurations handle the packaging of the application as an
executable and copying it to a location developers want to run the
executable at. The files can be copied to a location in the file system of
the development PC or to a mobile device.
\QC allows you to create installation packages for mobile devices that are
suitable for publishing to Nokia Store and other channels.
*/