diff --git a/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc b/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc index 5706b2d70dd..b9eb672eb01 100644 --- a/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc @@ -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 */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc b/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc index 7e77b016b4c..a1dc27193c7 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc @@ -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 > diff --git a/doc/qtcreator/src/editors/creator-diff-editor.qdoc b/doc/qtcreator/src/editors/creator-only/creator-diff-editor.qdoc similarity index 72% rename from doc/qtcreator/src/editors/creator-diff-editor.qdoc rename to doc/qtcreator/src/editors/creator-only/creator-diff-editor.qdoc index 8557cd8bffb..de83a3e1ab7 100644 --- a/doc/qtcreator/src/editors/creator-diff-editor.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-diff-editor.qdoc @@ -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: diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index c38beb825d3..5f254d59923 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -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} diff --git a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc index 2363e10a56b..829a711138f 100644 --- a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc @@ -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 diff --git a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc index 06226006d58..24f3b38479c 100644 --- a/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-file-system-view.qdoc @@ -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 diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc index d483e54ca9d..c0c8386911f 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc @@ -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 diff --git a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc index 0b0cbb0ee20..f5662a33fa9 100644 --- a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc +++ b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc @@ -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 */ diff --git a/doc/qtdesignstudio/src/overviews/studio-finding.qdoc b/doc/qtdesignstudio/src/overviews/studio-finding.qdoc index ead5bc33af1..231efcef3eb 100644 --- a/doc/qtdesignstudio/src/overviews/studio-finding.qdoc +++ b/doc/qtdesignstudio/src/overviews/studio-finding.qdoc @@ -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 diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index d0b451e6299..4ecc7f4cfdd 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -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