forked from qt-creator/qt-creator
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:
@@ -75,6 +75,6 @@
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\if defined(qtcreator)
|
\if defined(qtcreator)
|
||||||
\sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Comparing Files}
|
\sa {Edit Code}{How To: Edit Code}, {Edit Mode}
|
||||||
\endif
|
\endif
|
||||||
*/
|
*/
|
||||||
|
@@ -52,7 +52,7 @@
|
|||||||
To paste any content that you copied to the clipboard, select
|
To paste any content that you copied to the clipboard, select
|
||||||
\uicontrol Tools > \uicontrol {Code Pasting} > \uicontrol {Paste Snippet}.
|
\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.
|
chunk and select \uicontrol {Send Chunk to CodePaster} in the context menu.
|
||||||
|
|
||||||
To fetch a snippet of code from the server, select \uicontrol Tools >
|
To fetch a snippet of code from the server, select \uicontrol Tools >
|
||||||
|
@@ -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
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||||
|
|
||||||
// **********************************************************************
|
// **********************************************************************
|
||||||
@@ -9,31 +9,31 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\page creator-diff-editor.html
|
\page creator-diff-editor.html
|
||||||
\if defined(qtdesignstudio)
|
\previouspage creator-how-tos.html
|
||||||
\previouspage qt-quick-toolbars.html
|
|
||||||
\nextpage studio-finding.html
|
|
||||||
\else
|
|
||||||
\previouspage creator-macros.html
|
|
||||||
\nextpage creator-clang-codemodel.html
|
|
||||||
\endif
|
|
||||||
|
|
||||||
\title Comparing Files
|
\ingroup creator-how-to-edit
|
||||||
|
|
||||||
You can use a diff editor to display unsaved changes in the current file or
|
\title Compare files
|
||||||
all open files or to compare any two text files that can be either versions
|
|
||||||
of the same file or arbitrary 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}.
|
\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}.
|
\uicontrol Diff > \uicontrol {Diff Open Files}.
|
||||||
|
|
||||||
|
\section1 Compare two files
|
||||||
|
|
||||||
To compare two files:
|
To compare two files:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Select \uicontrol Tools > \uicontrol Diff >
|
\li Go to \uicontrol Tools > \uicontrol Diff >
|
||||||
\uicontrol {Diff External Files}.
|
\uicontrol {Diff External Files}.
|
||||||
|
|
||||||
\li Select two files to compare.
|
\li Select two files to compare.
|
||||||
@@ -47,30 +47,26 @@
|
|||||||
|
|
||||||
\li Open the first file in an editor.
|
\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
|
or \uicontrol {File System} view and select
|
||||||
\uicontrol {Diff Against Current File}.
|
\uicontrol {Diff Against Current File}.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
If \QC cannot detect the encoding of the files to compare, an info bar
|
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}.
|
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
|
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
|
removed text (painted another shade of red) in the left pane and green
|
||||||
indicates lines that contain added text (painted another shade of green)
|
indicates lines that contain added text (painted another shade of green)
|
||||||
in the right pane.
|
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
|
To view the differences in a unified view where changed rows are placed
|
||||||
below each other, select \inlineimage icons/unifieddiff.png
|
below each other, select \inlineimage icons/unifieddiff.png
|
||||||
(\uicontrol {Switch to Unified Diff Editor}).
|
(\uicontrol {Switch to Unified Diff Editor}).
|
||||||
@@ -85,22 +81,34 @@
|
|||||||
show in \uicontrol {Context lines}.
|
show in \uicontrol {Context lines}.
|
||||||
|
|
||||||
By default, the horizontal scroll bars in the left and right pane are
|
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
|
\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
|
If the files change outside \QC, select \inlineimage icons/reload_gray.png
|
||||||
(\uicontrol {Reload Editor}) to compare them again and to show the results.
|
(\uicontrol {Reload Editor}) to compare them again and to show the results.
|
||||||
|
|
||||||
\if defined(qtcreator)
|
\if defined(qtcreator)
|
||||||
|
\section1 Paste changes for review
|
||||||
|
|
||||||
To send a chunk of changes to a \l{Pasting and Fetching Code Snippets}
|
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
|
{code pasting service}, select \uicontrol {Send Chunk to CodePaster} in the
|
||||||
context menu.
|
context menu.
|
||||||
\endif
|
\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
|
\uicontrol {Text Editor} > \uicontrol {Font & Colors}. Create your own color
|
||||||
scheme and select new colors for the following items:
|
scheme and select new colors for the following items:
|
||||||
|
|
@@ -34,7 +34,6 @@
|
|||||||
\li \l{Using Qt Quick Toolbars}
|
\li \l{Using Qt Quick Toolbars}
|
||||||
\li \l{Pasting and Fetching Code Snippets}
|
\li \l{Pasting and Fetching Code Snippets}
|
||||||
\li \l{Using Text Editing Macros}
|
\li \l{Using Text Editing Macros}
|
||||||
\li \l{Comparing Files}
|
|
||||||
\endlist
|
\endlist
|
||||||
\li \l{Configuring the Editor}
|
\li \l{Configuring the Editor}
|
||||||
\li \l{Using GitHub Copilot}
|
\li \l{Using GitHub Copilot}
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
\page qt-quick-toolbars.html
|
\page qt-quick-toolbars.html
|
||||||
\if defined(qtdesignstudio)
|
\if defined(qtdesignstudio)
|
||||||
\previouspage creator-preferences-qtquick-code-style.html
|
\previouspage creator-preferences-qtquick-code-style.html
|
||||||
\nextpage creator-diff-editor.html
|
\nextpage studio-finding.html
|
||||||
\else
|
\else
|
||||||
\previouspage creator-completing-code.html
|
\previouspage creator-completing-code.html
|
||||||
\nextpage creator-editor-codepasting.html
|
\nextpage creator-editor-codepasting.html
|
||||||
|
@@ -83,8 +83,10 @@
|
|||||||
new filename.
|
new filename.
|
||||||
\li Remove existing files.
|
\li Remove existing files.
|
||||||
\li Create new folders.
|
\li Create new folders.
|
||||||
|
\if defined(qtcreator)
|
||||||
\li Compare the selected file with the currently open file in the diff
|
\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 Display the contents of a particular directory in the view.
|
||||||
\li Collapse all open folders.
|
\li Collapse all open folders.
|
||||||
\endlist
|
\endlist
|
||||||
|
@@ -142,7 +142,7 @@
|
|||||||
\image qtcreator-vcs-diff.png
|
\image qtcreator-vcs-diff.png
|
||||||
|
|
||||||
With Git, Mercurial, and Subversion, the diff is displayed side-by-side in
|
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
|
instead, select the \uicontrol {Switch to Text Diff Editor} (1) option from
|
||||||
the toolbar. In the inline
|
the toolbar. In the inline
|
||||||
diff view, you can use context menu commands to apply, revert, stage, and
|
diff view, you can use context menu commands to apply, revert, stage, and
|
||||||
|
@@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
\image qtcreator-vcs-diff.png
|
\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
|
the unified diff view instead, select the
|
||||||
\uicontrol {Switch to Unified Diff Editor} (1) option from the toolbar.
|
\uicontrol {Switch to Unified Diff Editor} (1) option from the toolbar.
|
||||||
In both views, you can use context menu commands to apply, revert, stage,
|
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.
|
visible only when you have merge conflicts to resolve.
|
||||||
|
|
||||||
\if defined(qtcreator)
|
\if defined(qtcreator)
|
||||||
\sa {Set up version control systems}, {Version Control Systems}
|
\sa {Compare files}, {Set up version control systems},
|
||||||
|
{Version Control Systems}
|
||||||
\endif
|
\endif
|
||||||
*/
|
*/
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\page studio-finding.html
|
\page studio-finding.html
|
||||||
\previouspage creator-diff-editor.html
|
\previouspage qt-quick-toolbars.html
|
||||||
\nextpage creator-editor-finding.html
|
\nextpage creator-editor-finding.html
|
||||||
|
|
||||||
\title Finding
|
\title Finding
|
||||||
|
@@ -207,7 +207,6 @@
|
|||||||
\li \l{Behavior}
|
\li \l{Behavior}
|
||||||
\li \l{Qt Quick Code Style}
|
\li \l{Qt Quick Code Style}
|
||||||
\li \l{Using Qt Quick Toolbars}
|
\li \l{Using Qt Quick Toolbars}
|
||||||
\li \l{Comparing Files}
|
|
||||||
\endlist
|
\endlist
|
||||||
\li \l{Finding}
|
\li \l{Finding}
|
||||||
\list
|
\list
|
||||||
|
Reference in New Issue
Block a user