2023-05-30 16:15:52 +02:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
2022-08-19 15:59:36 +02:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
// 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.
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\page creator-coding.html
|
2018-08-10 16:15:05 +02:00
|
|
|
\if defined(qtdesignstudio)
|
2021-11-18 15:25:02 +01:00
|
|
|
\previouspage studio-designer-developer-workflow.html
|
2018-08-10 16:15:05 +02:00
|
|
|
\else
|
|
|
|
|
\previouspage creator-usability.html
|
|
|
|
|
\endif
|
2015-11-19 12:56:17 +01:00
|
|
|
\nextpage creator-editor-functions.html
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
\title Coding
|
|
|
|
|
|
2018-10-18 16:00:21 +02:00
|
|
|
\if defined(qtcreator)
|
2020-05-20 16:16:05 +02:00
|
|
|
\image front-coding.png
|
2018-10-18 16:00:21 +02:00
|
|
|
\endif
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Writing Code}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
Writing, editing, and navigating in source code are core tasks in
|
|
|
|
|
application development. Therefore, the code editor is one of the
|
2015-06-18 10:41:19 +02:00
|
|
|
key components of \QC. You can use the code editor in the
|
|
|
|
|
\uicontrol Edit mode.
|
2011-12-13 11:52:47 +01:00
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Finding}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
Use the incremental and advanced search to search from currently
|
|
|
|
|
open projects or files on the file system or use the locator to
|
2015-06-18 10:41:19 +02:00
|
|
|
browse through projects, files, classes, functions, documentation
|
|
|
|
|
and file systems.
|
2011-12-13 11:52:47 +01:00
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Refactoring}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
Code refactoring is the process of improving and simplifying code
|
|
|
|
|
without modifying the existing functionality of an application. You
|
|
|
|
|
can easily find and rename symbols and apply predefined actions to
|
|
|
|
|
refactor code.
|
|
|
|
|
|
2018-08-22 15:45:57 +02:00
|
|
|
\if defined(qtcreator)
|
2014-03-05 13:35:19 +01:00
|
|
|
\li \l{Beautifying Source Code}
|
|
|
|
|
|
|
|
|
|
Beautifying code means applying indentation and style to source
|
|
|
|
|
code files. You can use the Artistic Style, ClangFormat, or
|
|
|
|
|
Uncrustify tool to format source files.
|
2018-08-22 15:45:57 +02:00
|
|
|
\endif
|
2014-03-05 13:35:19 +01:00
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Configuring the Editor}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
You can change the fonts, colors, highlighting, and indentation.
|
2018-08-22 15:45:57 +02:00
|
|
|
\if defined(qtcreator)
|
2014-03-04 00:12:11 +01:00
|
|
|
If you are used to the Vim editor, you can even run the main
|
2014-12-11 15:43:19 +01:00
|
|
|
editor in a manner similar to it in the \uicontrol{FakeVim} mode.
|
2018-08-22 15:45:57 +02:00
|
|
|
\endif
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
2018-08-22 15:45:57 +02:00
|
|
|
\if defined(qtcreator)
|
2011-12-13 11:52:47 +01:00
|
|
|
\section1 Related Topics
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
|
2023-04-27 16:54:10 +02:00
|
|
|
\li \l{Editing Markdown Files}
|
|
|
|
|
|
|
|
|
|
Edit and preview markdown (.md) files.
|
|
|
|
|
|
2018-10-11 14:54:35 +02:00
|
|
|
\li \l{Using Language Servers}
|
|
|
|
|
|
2023-02-03 17:25:21 +01:00
|
|
|
The language client offers code completion, highlighting of the
|
2019-06-17 14:59:06 +02:00
|
|
|
symbol under cursor, and jumping to the symbol definition for other
|
|
|
|
|
programming languages besides C++. In addition, it integrates
|
|
|
|
|
diagnostics from the language server.
|
2018-10-11 14:54:35 +02:00
|
|
|
|
2023-05-30 16:15:52 +02:00
|
|
|
\li \l {Using GitHub Copilot}
|
|
|
|
|
|
|
|
|
|
The experimental Copilot plugin integrates
|
|
|
|
|
\l{https://github.com/features/copilot}{GitHub Copilot} into \QC.
|
|
|
|
|
You can view suggestions from Copilot in the code editor.
|
|
|
|
|
|
2023-06-07 11:53:09 +02:00
|
|
|
\li \l{Developing Qt for Python Applications}
|
|
|
|
|
|
|
|
|
|
To support developing Qt for Python applications, \QC lets you
|
|
|
|
|
set up Qt for Python, use project wizards to create Qt for
|
|
|
|
|
Python applications, write Python code, and run and debug the
|
|
|
|
|
applications.
|
|
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Editing MIME Types}
|
2011-12-13 11:52:47 +01:00
|
|
|
|
|
|
|
|
\QC uses the MIME type of a file to determine which mode and editor
|
|
|
|
|
to use for opening the file. If your files do not match the
|
|
|
|
|
predefined MIME types, you can edit the MIME types.
|
|
|
|
|
|
2015-11-20 14:52:51 +01:00
|
|
|
\li \l{Modeling}
|
2014-01-10 14:15:59 +01:00
|
|
|
|
2018-02-08 10:21:36 +01:00
|
|
|
You can use the model editor to create Universal Modeling Language
|
|
|
|
|
(UML) style models with structured and behavioral diagrams that
|
2023-02-03 17:25:21 +01:00
|
|
|
show your system in many ways and store them in XML format.
|
2014-01-10 14:15:59 +01:00
|
|
|
|
2016-09-30 12:46:20 +02:00
|
|
|
\li \l{Editing State Charts}
|
|
|
|
|
|
|
|
|
|
You can use \QC to create applications that embed state machines. A
|
|
|
|
|
project wizard creates \l{https://www.w3.org/TR/scxml/}
|
|
|
|
|
{State Chart XML (SCXML)} files with boilerplate code that you can
|
|
|
|
|
edit using an experimental SCXML editor. You can use the classes in
|
|
|
|
|
the Qt SCXML module to embed state machines created from the files
|
|
|
|
|
in Qt applications.
|
|
|
|
|
|
2011-12-13 11:52:47 +01:00
|
|
|
\endlist
|
2018-08-22 15:45:57 +02:00
|
|
|
\endif
|
2011-12-13 11:52:47 +01:00
|
|
|
*/
|