2011-12-13 11:52:47 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (c) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2011-12-13 11:52:47 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator
|
2011-12-13 11:52:47 +01:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** 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.
|
|
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
// 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-coding.html
|
|
|
|
|
\page creator-editor-functions.html
|
|
|
|
|
\nextpage creator-coding-navigating.html
|
|
|
|
|
|
|
|
|
|
\title Writing Code
|
|
|
|
|
|
|
|
|
|
The \QC code editor is fully equipped with semantic highlighting, syntax
|
|
|
|
|
checking, code completion, code indentation, context sensitive help, and
|
|
|
|
|
in-line error indicators while you are typing.
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Working in Edit Mode}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
You can use the editor toolbar to navigate between open files
|
|
|
|
|
and symbols in use. You can also split the view to work on
|
|
|
|
|
several files simultaneously, add bookmarks, and move between
|
|
|
|
|
symbol definitions and declarations.
|
|
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Semantic Highlighting}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
\QC enables you to write well formatted code by highlighting
|
|
|
|
|
code elements and blocks. You can use syntax highlighting
|
|
|
|
|
also for other types of files than C++ or QML.
|
|
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Checking Code Syntax}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
\QC checks for errors when you write code and displays inline
|
|
|
|
|
error and warning messages.
|
2012-02-09 12:35:15 +01:00
|
|
|
Similarly, it checks the data structure of an instance of a
|
|
|
|
|
JavaScript object notation (JSON) entity. In addition, you can run
|
|
|
|
|
static checks on the QML and JavaScript code in your project to find
|
|
|
|
|
common problems.
|
2011-12-13 11:52:47 +01:00
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Completing Code}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
\QC anticipates what you are going to write and completes code
|
|
|
|
|
and code snippets for elements, properties, and IDs.
|
|
|
|
|
|
2013-04-05 10:55:53 +02:00
|
|
|
\li \l{Indenting Text or Code}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
2013-04-05 10:55:53 +02:00
|
|
|
\QC indents text and code according to rules that you specify separately for
|
|
|
|
|
files that contain C++ or QML code and for other text files.
|
2011-12-13 11:52:47 +01:00
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Using Qt Quick Toolbars}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
When you edit QML code in the code editor, you specify the
|
|
|
|
|
properties of QML components. For some properties, such as
|
|
|
|
|
colors and font names, this is not a trivial task. For example,
|
|
|
|
|
few people can visualize the color #18793f. To easily edit these
|
|
|
|
|
properties, you can use the Qt Quick Toolbars.
|
|
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Pasting and Fetching Code Snippets}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
You can cooperate with other developers by pasting and fetching
|
|
|
|
|
snippets of code from a server. For example, you might ask
|
|
|
|
|
colleagues to review a change that you plan to submit to a
|
|
|
|
|
version control system.
|
|
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Using Text Editing Macros}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
When you have a file open in the code editor, you can record a
|
|
|
|
|
keyboard sequence as a macro. You can then play the macro to
|
|
|
|
|
repeat the sequence. You can save the latest macro and assign a
|
|
|
|
|
keyboard shortcut for running it or run it from the locator.
|
|
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
*/
|