diff --git a/doc/images/qtcreator-font-colors.png b/doc/images/qtcreator-font-colors.png new file mode 100644 index 0000000000000000000000000000000000000000..ebb9a7f5f109130185367c9bd995d5d0e29e298e Binary files /dev/null and b/doc/images/qtcreator-font-colors.png differ diff --git a/doc/images/qtcreator-generic-highlighter.png b/doc/images/qtcreator-generic-highlighter.png new file mode 100644 index 0000000000000000000000000000000000000000..503720518d636999ceb3a1f22fb40978e865934d Binary files /dev/null and b/doc/images/qtcreator-generic-highlighter.png differ diff --git a/doc/images/qtcreator-indentation.png b/doc/images/qtcreator-indentation.png new file mode 100644 index 0000000000000000000000000000000000000000..0f3f772a7da77d46fe74af44ff4c608a264d2015 Binary files /dev/null and b/doc/images/qtcreator-indentation.png differ diff --git a/doc/images/qtcreator-manage-definitions.png b/doc/images/qtcreator-manage-definitions.png new file mode 100644 index 0000000000000000000000000000000000000000..53b8d455270cb56851133274c1c6f27b45c304f5 Binary files /dev/null and b/doc/images/qtcreator-manage-definitions.png differ diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index e7c1813f1daa452c624b2ae8cf0824ea757c7a86..4423bb5b597bc2e99b1dc8071c2f05686aaa54cf 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -1166,10 +1166,14 @@ needs. To configure the editor, select \gui Tools > \gui{Options...} > \gui{Text Editor}. + \image qtcreator-font-colors.png "Text editor options" + You can perform the following configuration actions: \list - \o Set the font preferences and apply syntax highlighting in + \o Set the font preferences and apply color schemes for syntax highlighting in \gui{Font & Colors}. + \o Specify definition files for syntax highlighting for other types of files than + C++ or QML in \gui{Generic Highlighter}. \o Set tabs, indentation, the handling of whitespace, and mouse operations in \gui Behavior. \o Set various display properties, for example, @@ -1196,7 +1200,10 @@ \section2 Defining Color Schemes You can select one of the predefined color schemes for syntax highlighting - or create customized color schemes. To create a color scheme: + or create customized color schemes. The color schemes apply to highlighting + both C++ and QML files and generic files. + + To create a color scheme: \list 1 @@ -1219,8 +1226,62 @@ format. The latter makes sure that syntax highlighting is preserved when pasting to a rich-text editor. + \section2 Generic Highlighting + + Generic highlighting is based on highlight definition files that are provided by the + \l{http://kate-editor.org/2005/03/24/writing-a-syntax-highlighting-file/}{Kate Editor}. + You can download highlight definition files for use with Qt Creator. + + If you have a Unix installation that comes with the Kate Editor, you might already + have the definition files installed. Typically, the files are in a read-only directory, + and therefore, you cannot manage them. Qt Creator can try to locate them and use them + as fallback files, when the primary location does not contain the definition for the + current file type. You can also specify the directory that contains preinstalled + highlight definition files as the primary location. + + When you open a file for editing and the editor cannot find the highlight definition + for it, an alert appears. You can turn off the alerts. You can also specify patterns + for ignoring files. The editor will not alert you if highlight definitions for the + ignored files are not found. + + To download highlight definition files: + + \list 1 + + \o Select \gui {Tools > Options... > Text Editor > Generic Highlighter}. + + \image qtcreator-generic-highlighter.png "Generic Highlighter options" + + \o In the \gui Location field, specify the path to the primary location for + highlight definition files. + + \o Click \gui Manage to open a list of highlight definition files available for + download. + + \image qtcreator-manage-definitions.png "Manage Definitions dialog" + + \o Select highlight definition files in the list and click \gui{Download Selected + Definitions}. + + \o Select the \gui {Use fallback location} to specify the secondary location + where the editor will look for highlight definition files. + + \o Click \gui Autodetect to allow Qt Creator to look for highlight definition + files on your system, or click \gui Browse to locate them in the file system + yourself. + + \o In the \gui {Ignored file patterns} field, specify file patterns. You will not + receive alerts if the highlight definitions for the specified files are not found. + + \o Click \gui OK to save your changes. + + \endlist + + \section2 Indenting Code + \image qtcreator-indentation.png "Text Editor Behavior options" + When you type code, it is indented automatically according to the selected options. Select a block to indent it when you press \key Tab. Press \key {Shift+Tab} to decrease the indentation.