// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

// **********************************************************************
// 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-editor-external.html
    \if defined(qtdesignstudio)
    \previouspage creator-vcs-git.html
    \nextpage studio-accessing-output-issues-and-warnings.html
    \else
    \previouspage creator-how-tos.html
    \endif

    \ingroup creator-how-to-use

    \title Use external tools

    You can add menu items for using external tools directly from \QC to
    \uicontrol Tools > \uicontrol External. As examples, the menu shows
    items for opening the currently active file for editing in a text editor
    or running the currently active QML file.

    To run the tools, select \uicontrol Tools > \uicontrol External, or use the
    \c x filter in the locator.

    \section1 Configure external tools

    You can change the configuration of preconfigured tools and configure
    additional tools in \preferences > \uicontrol {Environment} >
    \uicontrol {External Tools}.

    \image {qtcreator-external-tools.webp} {External Tools tab in Environment preferences}

    \if defined(qtcreator)
    Select \inlineimage {icons/replace.png} {Variables} (\uicontrol {Variables})
    in a field to select from a list of \l{Use \QC variables}{variables} that are
    available in a particular context.
    \endif


    To configure external tools:

    \list 1

        \li Select \uicontrol Tools > \uicontrol External >
            \uicontrol Configure.

        \li Select \uicontrol Add > \uicontrol {Add Tool}
            to add a new tool. You can also select \uicontrol {Add Category} to add a
            new category.

        \li In the \uicontrol Executable field, specify the executable to run. If the
            executable is found in your system PATH variable, do not specify
            the path to it.

        \li In the \uicontrol Arguments field, specify optional arguments for running
            the executable.

        \li In the \uicontrol {Working directory} field, specify the path to the
            working directory.

        \li In the \uicontrol Output field, select how to handle output from the
            tool.
            \if defined(qtcreator)
            You can ignore the output, view it in \l{View output}
            {General Messages}, or replace the selected text with the
            output in the code editor.
            \endif

        \li In the \uicontrol {Error output} field, select how to handle error
            messages from the tool.

        \if defined(qtcreator)
        \li In the \uicontrol {Base environment} field, select whether to run
            the tool in the system environment or the \l{Specify the environment for projects}
            {build environment} or \l {Specify the run environment}
            {run environment} of the active project. Select the build or run
            environment if the system environment does not have the necessary
            PATH settings to find the toolchain, for example.
        \else
        \li In the \uicontrol {Base environment} field, use the default settings.
        \endif

        \li In the \uicontrol Environment field, select \uicontrol Change to modify
            environment variable values for build and run environments in
            the \uicontrol {Edit Environment} dialog.

            To globally change the system environment from the one in which
            \QC is started, select \preferences >
            \uicontrol Environment > \uicontrol System, and then select
            \uicontrol Change in the \uicontrol Environment field.

        \li Select \uicontrol {Modifies current document} to make sure
            that if the current document is modified by the tool, it is saved
            before the tool is run and reloaded after the tool finishes.

        \li In the \uicontrol Input field, specify text that is passed as standard
            input to the tool.

    \endlist

    The category and tool are added to the \uicontrol Tools >
    \uicontrol External menu.

    If you change the configuration of preconfigured tools, you can later
    revert the changes by selecting the \uicontrol Reset button.

    The tool configurations that you add and modify are stored in XML format in
    the user's configuration folder. For example,
    \c {~/config/QtProject/qtcreator/externaltools}
    on Linux and \macos and
    \c {C:\Users\username\AppData\Roaming\QtProject\qtcreator\externaltools}
    in Windows. To share a configuration with other users, copy an XML
    configuration file to the folder.

    \sa {Run QML files}, {Use external text editors}, {Use Qt Linguist}

    \if defined(qtcreator)
    \sa {Edit environment settings}, {Specify the environment for projects},
    {Use Qt Creator variables}
    \endif
*/

/*!
    \page creator-how-to-use-qtlinguist.html
    \if defined(qtdesignstudio)
    \previouspage creator-editor-external.html
    \else
    \previouspage creator-how-tos.html
    \endif

    \ingroup creator-how-to-use

    \title Use Qt Linguist

    Most of the text to translate in an application consists of either single
    words or short phrases. These typically appear as window titles, menu items,
    tooltips, and labels to buttons, checkboxes, and radio buttons.

    You mark the phrases as translatable in the QML and C++ source code. Qt
    localization tools provide context information for each of the phrases to
    help the translator understand their meaning. You can add comments to the
    phrases.

    Translation files contain all the user-visible text and keyboard shortcuts
    in an application and translations of that text.

    When you \l{Creating Projects}{create a new project}, you can automatically
    generate a translation source file (TS) for one language. To add other
    languages, edit the project file or go to \uicontrol File >
    \uicontrol {New File}.

    To open TS files in Qt Linguist, right-click a TS file in the
    \uicontrol Projects or \uicontrol {File System} view and go to
    \uicontrol {Open With} > \uicontrol {Qt Linguist} in the context menu.

    \if defined(qtcreator)
    \sa {Add translation files}
    \endif

    \sa {Internationalization with Qt}, {Qt Linguist Manual}
*/

/*!
    \page creator-how-to-run-qml-files.html
    \if defined(qtdesignstudio)
    \previouspage creator-editor-external.html
    \else
    \previouspage creator-how-tos.html
    \endif

    \ingroup creator-how-to-design

    \title Run QML files

    You can test the current QML document while you are developing an application.

    To run the currently active QML file, select \uicontrol Tools >
    \uicontrol External > \uicontrol {Qt Quick} > \uicontrol {QML Runtime}.

    \sa {Use external tools}

    \if defined(qtcreator)
    \sa {Design UIs}{How To: Design UIs}, {UI Design}
    \endif
*/

/*!
    \page creator-how-to-use-external-text-editors.html
    \if defined(qtdesignstudio)
    \previouspage creator-editor-external.html
    \else
    \previouspage creator-how-tos.html
    \endif

    \ingroup creator-how-to-use

    \title Use external text editors

    To open files for editing in the default text editor for your system:

    \list 1
        \li Right-click the filename in one of the following views to open a context
            menu:
            \list
                \if defined(qtcreator)
                \li \l {Edit mode}
                \endif
                \li \l {File System}
                \li \l {Open Documents}
                \li \l {Projects}
            \endlist
        \li Select \uicontrol {Open With} > \uicontrol {System Editor}.
    \endlist

    \section1 Switch between editor types

    To switch between editor types, right-click the filename and select
    \uicontrol {Open With} > \uicontrol {Cycle to Next Editor}.

    You can assign a keyboard shortcut for \uicontrol {Cycle to Next Editor}.
    For more information, see \l {Assign keyboard shortcuts}.

    \section1 Add editors to Tools menu

    You can add menu items for opening the file you are currently viewing in
    an external editor to \uicontrol Tools > \uicontrol External >
    \uicontrol Text. The current example commands are
    \uicontrol {Edit with Notepad} on Windows and \uicontrol {Edit with vi} on
    Linux and \macos.

    \QC looks for the editor path in the PATH environment variable
    of your operating system.

    \sa {Use external tools}
*/
