summaryrefslogtreecommitdiff
path: root/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc
blob: fa87b7ebb9b7042c5ec2d6d95e5a813932a8e13a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/

// **********************************************************************
// 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

        \li \l{Working in Edit Mode}

            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.

        \li \l{Semantic Highlighting}

            \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.

        \li \l{Checking Code Syntax}

            \QC checks for errors when you write code and displays inline
            error and warning messages.
            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.

        \li \l{Completing Code}

            \QC anticipates what you are going to write and completes code
            and code snippets for elements, properties, and IDs.

        \li \l{Indenting Text or Code}

            \QC indents text and code according to rules that you
            specify separately for files that contain C++, QML, or
            Nim (experimental) code and for other text files.

        \li \l{Using Qt Quick Toolbars}

            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 \c {#18793f}. To easily edit
            these properties, you can use the Qt Quick Toolbars.

        \if defined(qtcreator)
        \li \l{Pasting and Fetching Code Snippets}

            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.

        \li \l{Using Text Editing Macros}

            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.
        \endif

    \endlist

    \section1 Related Topics

    \list

        \li \l{Comparing Files}

            You can use a diff editor to compare two versions of a file and
            view the differences side-by-side in the \uicontrol Edit mode.

        \if defined(qtcreator)
        \li \l{Parsing C++ Files with the Clang Code Model}

            The Clang code model provides some of the services previously
            provided by the built-in C/C++ code model, such as code
            completion, syntactic and semantic highlighting, diagnostics,
            tooltips, outline of symbols, and renaming of local symbols.
        \endif

    \endlist

*/