Doc: Turn "Comparing Files" into a how-to topic

Hide it from the QDS Manual.

Task-number: QTCREATORBUG-29361
Change-Id: I7c44aaed42e374b8e07d093279c8078ada18c250
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Leena Miettinen
2024-03-05 17:02:51 +01:00
parent 7c6c08a8ba
commit 8c0bb53c76
10 changed files with 48 additions and 39 deletions

View File

@@ -75,6 +75,6 @@
\endlist
\if defined(qtcreator)
\sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Comparing Files}
\sa {Edit Code}{How To: Edit Code}, {Edit Mode}
\endif
*/

View File

@@ -52,7 +52,7 @@
To paste any content that you copied to the clipboard, select
\uicontrol Tools > \uicontrol {Code Pasting} > \uicontrol {Paste Snippet}.
To paste content from the \l{Comparing Files}{diff editor}, right-click a
To paste content from the \l{Compare files}{diff editor}, right-click a
chunk and select \uicontrol {Send Chunk to CodePaster} in the context menu.
To fetch a snippet of code from the server, select \uicontrol Tools >

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2020 The Qt Company Ltd.
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
// **********************************************************************
@@ -9,31 +9,31 @@
/*!
\page creator-diff-editor.html
\if defined(qtdesignstudio)
\previouspage qt-quick-toolbars.html
\nextpage studio-finding.html
\else
\previouspage creator-macros.html
\nextpage creator-clang-codemodel.html
\endif
\previouspage creator-how-tos.html
\title Comparing Files
\ingroup creator-how-to-edit
You can use a diff editor to display unsaved changes in the current file or
all open files or to compare any two text files that can be either versions
of the same file or arbitrary files.
\title Compare files
To view unsaved changes in the current file, select \uicontrol Tools >
You can view unsaved changes in the current file or all open files,
as well as compare any two text files. They can be either versions of
the same file or arbitrary files.
\section1 View unsaved changes
To view unsaved changes in the current file, go to \uicontrol Tools >
\uicontrol Diff > \uicontrol {Diff Current File}.
To view unsaved changes in all open files, select \uicontrol Tools >
To view unsaved changes in all open files, go to \uicontrol Tools >
\uicontrol Diff > \uicontrol {Diff Open Files}.
\section1 Compare two files
To compare two files:
\list 1
\li Select \uicontrol Tools > \uicontrol Diff >
\li Go to \uicontrol Tools > \uicontrol Diff >
\uicontrol {Diff External Files}.
\li Select two files to compare.
@@ -41,36 +41,32 @@
\endlist
To compare the currently opened file against another file in a project
or the filesystem:
or the file system:
\list 1
\li Open the first file in an editor.
\li Right click on the second file in the \uicontrol Projects
\li Right-click the second file in the \uicontrol Projects
or \uicontrol {File System} view and select
\uicontrol {Diff Against Current File}.
\endlist
If \QC cannot detect the encoding of the files to compare, an info bar
appears that displays the option to reload the document using some other
displays the option to reload the document using some other
encoding. For more information, see \l {Change text encoding}.
\section1 Viewing the Changes
\section1 View changes
\image creator-diff-editor.png "Diff editor output in the Edit mode"
\image creator-diff-editor.png {Diff editor output in the Edit mode}
The changes are displayed in the \uicontrol Edit mode. Color coding is
View the changes in the \uicontrol Edit mode. Color coding is
used to mark changed lines. By default, red indicates lines that contain
removed text (painted another shade of red) in the left pane and green
indicates lines that contain added text (painted another shade of green)
in the right pane.
To revert the changes, right-click added text and then select
\uicontrol {Revert Chunk} in the context menu. To apply the changes, select
removed text and then select \uicontrol {Apply Chunk}.
To view the differences in a unified view where changed rows are placed
below each other, select \inlineimage icons/unifieddiff.png
(\uicontrol {Switch to Unified Diff Editor}).
@@ -85,22 +81,34 @@
show in \uicontrol {Context lines}.
By default, the horizontal scroll bars in the left and right pane are
synchronized. To use them independently of each other, select the
synchronized. To use them independently of each other, select
\inlineimage icons/linkicon.png
(\uicontrol {Synchronize Horizontal Scroll Bars}) button.
(\uicontrol {Synchronize Horizontal Scroll Bars}).
\section1 Revert and apply changes
To revert the changes, right-click added text and then select
\uicontrol {Revert Chunk} in the context menu.
To apply the changes, select removed text and then select
\uicontrol {Apply Chunk}.
\section1 Reload files
If the files change outside \QC, select \inlineimage icons/reload_gray.png
(\uicontrol {Reload Editor}) to compare them again and to show the results.
\if defined(qtcreator)
\section1 Paste changes for review
To send a chunk of changes to a \l{Pasting and Fetching Code Snippets}
{code pasting service}, select \uicontrol {Send Chunk to CodePaster} in the
context menu.
\endif
\section1 Changing the Colors
\section1 Change colors
To change the default colors, select \preferences >
To change the default colors, go to \preferences >
\uicontrol {Text Editor} > \uicontrol {Font & Colors}. Create your own color
scheme and select new colors for the following items:

View File

@@ -34,7 +34,6 @@
\li \l{Using Qt Quick Toolbars}
\li \l{Pasting and Fetching Code Snippets}
\li \l{Using Text Editing Macros}
\li \l{Comparing Files}
\endlist
\li \l{Configuring the Editor}
\li \l{Using GitHub Copilot}

View File

@@ -11,7 +11,7 @@
\page qt-quick-toolbars.html
\if defined(qtdesignstudio)
\previouspage creator-preferences-qtquick-code-style.html
\nextpage creator-diff-editor.html
\nextpage studio-finding.html
\else
\previouspage creator-completing-code.html
\nextpage creator-editor-codepasting.html

View File

@@ -83,8 +83,10 @@
new filename.
\li Remove existing files.
\li Create new folders.
\if defined(qtcreator)
\li Compare the selected file with the currently open file in the diff
editor. For more information, see \l{Comparing Files}.
editor. For more information, see \l{Compare files}.
\endif
\li Display the contents of a particular directory in the view.
\li Collapse all open folders.
\endlist

View File

@@ -142,7 +142,7 @@
\image qtcreator-vcs-diff.png
With Git, Mercurial, and Subversion, the diff is displayed side-by-side in
a \l{Comparing Files}{diff editor} by default. To use the inline diff view
a \l{Compare files}{diff editor} by default. To use the inline diff view
instead, select the \uicontrol {Switch to Text Diff Editor} (1) option from
the toolbar. In the inline
diff view, you can use context menu commands to apply, revert, stage, and

View File

@@ -79,7 +79,7 @@
\image qtcreator-vcs-diff.png
The \l{Comparing Files}{diff editor} displays the diff side-by-side. To use
The diff editor displays the diff side-by-side. To use
the unified diff view instead, select the
\uicontrol {Switch to Unified Diff Editor} (1) option from the toolbar.
In both views, you can use context menu commands to apply, revert, stage,
@@ -638,6 +638,7 @@
visible only when you have merge conflicts to resolve.
\if defined(qtcreator)
\sa {Set up version control systems}, {Version Control Systems}
\sa {Compare files}, {Set up version control systems},
{Version Control Systems}
\endif
*/

View File

@@ -3,7 +3,7 @@
/*!
\page studio-finding.html
\previouspage creator-diff-editor.html
\previouspage qt-quick-toolbars.html
\nextpage creator-editor-finding.html
\title Finding

View File

@@ -207,7 +207,6 @@
\li \l{Behavior}
\li \l{Qt Quick Code Style}
\li \l{Using Qt Quick Toolbars}
\li \l{Comparing Files}
\endlist
\li \l{Finding}
\list