forked from qt-creator/qt-creator
Doc: Divide "Creating Files" into How-to topics
Task-number: QTCREATORBUG-29361 Change-Id: Ib5e31777ef1649f86525b41bcfbcac52b9dd231e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
BIN
doc/qtcreator/images/qtcreator-remove-file.webp
Normal file
BIN
doc/qtcreator/images/qtcreator-remove-file.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
@@ -183,7 +183,7 @@
|
|||||||
|
|
||||||
\section1 Managing Files
|
\section1 Managing Files
|
||||||
|
|
||||||
When you use project wizard templates to \l{Creating Files}{add files} to
|
When you use project wizard templates to \l{Create files}{add files} to
|
||||||
a project, \QC automatically adds them to the \c {qt_add_executable()},
|
a project, \QC automatically adds them to the \c {qt_add_executable()},
|
||||||
\c {add_executable()}, or \c {qt_add_library()} function in the
|
\c {add_executable()}, or \c {qt_add_library()} function in the
|
||||||
CMakeLists.txt file.
|
CMakeLists.txt file.
|
||||||
|
@@ -62,6 +62,10 @@
|
|||||||
\list
|
\list
|
||||||
\li \l {Add a license header template for C++ code}
|
\li \l {Add a license header template for C++ code}
|
||||||
\li \l {Add subprojects to projects}
|
\li \l {Add subprojects to projects}
|
||||||
|
\li \l {Create C++ classes}
|
||||||
|
\li \l {Create files}
|
||||||
|
\li \l {Create OpenGL fragment and vertex shaders}
|
||||||
|
\li \l {Create resource files}
|
||||||
\li \l {Develop Qt for Python applications}
|
\li \l {Develop Qt for Python applications}
|
||||||
\li \l {Specify project contents}
|
\li \l {Specify project contents}
|
||||||
\li \l {Select the build system}
|
\li \l {Select the build system}
|
||||||
|
@@ -2,121 +2,207 @@
|
|||||||
// 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
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\previouspage creator-project-creating.html
|
|
||||||
\page creator-file-creating.html
|
\page creator-file-creating.html
|
||||||
\nextpage creator-project-opening.html
|
\previouspage creator-how-tos.html
|
||||||
|
|
||||||
\title Creating Files
|
\ingroup creator-how-to-projects
|
||||||
|
|
||||||
|
\title Create files
|
||||||
|
|
||||||
|
Use wizard templates to add individual files to your \l{Creating Projects}
|
||||||
|
{projects}.
|
||||||
|
|
||||||
|
To add files to projects, select \uicontrol File > \uicontrol {New File}, and
|
||||||
|
then select the type of the file.
|
||||||
|
|
||||||
\image qtcreator-new-file.webp {New File wizard}
|
\image qtcreator-new-file.webp {New File wizard}
|
||||||
|
|
||||||
Use wizard templates to add individual files to your \l{Creating Projects}
|
\section1 Select file type
|
||||||
{projects}. Select \uicontrol File > \uicontrol {New File} and
|
|
||||||
select the type of the file:
|
|
||||||
|
|
||||||
\list
|
The following table lists the types of wizard templates that you can use
|
||||||
\li \uicontrol {C/C++}: header and source files for new classes.
|
for creating files. The \uicontrol {New File} dialog shows detailed information about each file
|
||||||
\li \uicontrol {Modeling}: State Chart XML (SCXML) files,
|
wizard template.
|
||||||
Universal Modeling Language (UML) style \l {Modeling}{models},
|
|
||||||
and scratch models that use a temporary file.
|
\table
|
||||||
\li \uicontrol {Qt}: source and header files for item, table,
|
\header
|
||||||
|
\li Category
|
||||||
|
\li Purpose
|
||||||
|
\row
|
||||||
|
\li \uicontrol {C/C++}
|
||||||
|
\li Header and source files for new classes.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Modeling}
|
||||||
|
\li State Chart XML (SCXML) files, Universal Modeling Language (UML)
|
||||||
|
style \l {Modeling}{models}, and scratch models that use a temporary
|
||||||
|
file.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Qt}
|
||||||
|
\li Source and header files for item, table,
|
||||||
or list models, \QD forms and a matching classes for Qt Widgets
|
or list models, \QD forms and a matching classes for Qt Widgets
|
||||||
projects, Qt resource files, as well as QML and JavaScript files
|
projects, Qt resource files, as well as QML and JavaScript files
|
||||||
for Qt Quick projects.
|
for Qt Quick projects.
|
||||||
\li \uicontrol {GLSL}: fragment and vertex shaders.
|
\row
|
||||||
\li \uicontrol {General}: markdown files, empty files that you can save
|
\li \uicontrol {GLSL}
|
||||||
with any filename extension, and scratch buffers that use temporary
|
\li OpenGL fragment and vertex shaders.
|
||||||
files.
|
\row
|
||||||
\li \uicontrol {Java}: class files.
|
\li \uicontrol {General}
|
||||||
\li \uicontrol {Python}: class and script files for Python projects.
|
\li Markdown files, empty files that you can save with any filename
|
||||||
\li \uicontrol {vcpkg} (experimental): \l {Managing Packages with vcpkg}
|
extension, and scratch buffers that use temporary files.
|
||||||
{vcpkg package manager} manifest files (vcpkg.json).
|
\row
|
||||||
\li \uicontrol {Nim} (experimental): empty Nim source and script files.
|
\li \uicontrol {Java}
|
||||||
|
\li Class files.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Python}
|
||||||
|
\li Class and script files for Python projects.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {vcpkg} (experimental)
|
||||||
|
\li \l {Managing Packages with vcpkg}{vcpkg package manager} manifest
|
||||||
|
files (vcpkg.json).
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Nim} (experimental)
|
||||||
|
\li Empty Nim source and script files.
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
\sa {Create C++ classes}, {Create OpenGL fragment and vertex shaders},
|
||||||
|
{Create resource files}, {Use project wizards}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\page creator-how-to-create-cpp-classes.html
|
||||||
|
\previouspage creator-how-tos.html
|
||||||
|
|
||||||
|
\ingroup creator-how-to-projects
|
||||||
|
|
||||||
|
\title Create C++ classes
|
||||||
|
|
||||||
|
To create a C++ header and source file for a new class that you can add to a
|
||||||
|
C++ project:
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
\li Select \uicontrol File > \uicontrol {New File} >
|
||||||
|
\uicontrol {C++ Class Wizard} > \uicontrol Choose.
|
||||||
|
\li Specify the class name, base class, and header and source files for
|
||||||
|
the class.
|
||||||
|
\image qtcreator-cpp-class-wizard.png {Enter Class Name dialog}
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
The \uicontrol {New File} dialog shows detailed information about each file
|
|
||||||
wizard template.
|
|
||||||
|
|
||||||
\section1 C++ Classes
|
|
||||||
|
|
||||||
The \uicontrol {C++ Class Wizard} allows you to create a C++ header and source
|
|
||||||
file for a new class that you can add to a C++ project. Specify the class
|
|
||||||
name, base class, and header and source files for the class.
|
|
||||||
|
|
||||||
The wizard supports namespaces. To use a namespace, enter a qualified
|
The wizard supports namespaces. To use a namespace, enter a qualified
|
||||||
class name in the \uicontrol {Class name} field. For example:
|
class name in the \uicontrol {Class name} field. For example:
|
||||||
\c MyNamespace::MySubNamespace::MyClass. The wizard suggests
|
\c MyNamespace::MySubNamespace::MyClass. The wizard suggests
|
||||||
existing namespaces and class names as you type.
|
existing namespaces and class names as you type.
|
||||||
|
|
||||||
\image qtcreator-cpp-class-wizard.png "Enter Class Name dialog"
|
You can also create your own project and class wizards.
|
||||||
|
|
||||||
|
\section1 Set file naming preferences
|
||||||
|
|
||||||
The names of the header and source file are based on the class name. To
|
The names of the header and source file are based on the class name. To
|
||||||
change the default suffix of a file, select \uicontrol Edit > \uicontrol Preferences >
|
change the default suffix of a file, select \uicontrol Edit >
|
||||||
\uicontrol {C++} > \uicontrol {File Naming}.
|
\uicontrol Preferences > \uicontrol {C++} > \uicontrol {File Naming}.
|
||||||
|
|
||||||
\image qtcreator-options-cpp-files.png "C++ File Naming preferences"
|
\image qtcreator-options-cpp-files.png "C++ File Naming preferences"
|
||||||
|
|
||||||
In the \uicontrol {License template} field, you can use
|
In the \uicontrol {License template} field, enter
|
||||||
\l{Using Variables in Wizards}{predefined wizard variables} to specify the
|
\l{Using Variables in Wizards}{predefined wizard variables} to specify the
|
||||||
path and filename of the license to use in the source and header files.
|
path and filename of the license to use in the source and header files.
|
||||||
|
|
||||||
You can create your own project and class wizards. For more information,
|
\sa {Create files}, {Use project wizards}, {Adding New Custom Wizards}
|
||||||
see \l{Adding New Custom Wizards}.
|
*/
|
||||||
|
|
||||||
\section1 Resource Files
|
/*!
|
||||||
|
\page creator-how-to-create-resource-files.html
|
||||||
|
\previouspage creator-how-tos.html
|
||||||
|
|
||||||
\QC supports the \l{The Qt Resource System}{Qt Resource System}, which is a
|
\ingroup creator-how-to-projects
|
||||||
platform-independent mechanism for storing files in the application's
|
|
||||||
executable.
|
|
||||||
|
|
||||||
\image qtcreator-add-resource-wizard.png "New File dialog"
|
\title Create resource files
|
||||||
|
|
||||||
The wizard creates a resource collection file (.qrc) that you can manage in
|
The \l{The Qt Resource System}{Qt Resource System} is a platform-independent
|
||||||
the resource editor.
|
mechanism for storing files in the application's executable.
|
||||||
|
|
||||||
\image qtcreator-add-resource.png "Editing resource files"
|
To create a resource file:
|
||||||
|
|
||||||
Select \uicontrol {Add Files} to locate and add individual
|
\list 1
|
||||||
files.
|
\li Select \uicontrol File > \uicontrol {New File} > \uicontrol {Qt} >
|
||||||
|
\uicontrol {Qt Resource File} > \uicontrol Choose.
|
||||||
|
\image qtcreator-add-resource-wizard.png {New File dialog}
|
||||||
|
\li Follow the instructions of the wizard to create a resource
|
||||||
|
collection file (.qrc).
|
||||||
|
\li Open the resource file in the resource editor.
|
||||||
|
\image qtcreator-add-resource.png "Editing resource files"
|
||||||
|
\li Select \uicontrol {Add Files} to locate and add individual files.
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\section1 Sort resource files
|
||||||
|
|
||||||
To list the folders and files in ascending alphabetic order in the source
|
To list the folders and files in ascending alphabetic order in the source
|
||||||
tree, select \uicontrol {Sort Alphabetically} in the context menu.
|
tree, select \uicontrol {Sort Alphabetically} in the context menu.
|
||||||
|
|
||||||
By default, resources are accessible in the application under the same file
|
\section1 Set a path prefix
|
||||||
|
|
||||||
|
By default, resources in the application are accessible under the same file
|
||||||
name as they have in the source tree, with a \c{:/} prefix, or by a URL with
|
name as they have in the source tree, with a \c{:/} prefix, or by a URL with
|
||||||
a \c qrc scheme. To specify a path prefix for all files in the \c .qrc file,
|
a \c qrc scheme. To specify a path prefix for all files in the \c .qrc file,
|
||||||
select \uicontrol {Add Prefix} and enter the prefix in the \uicontrol Prefix
|
select \uicontrol {Add Prefix} and enter the prefix in the \uicontrol Prefix
|
||||||
field.
|
field.
|
||||||
|
|
||||||
|
\section1 Set a locale
|
||||||
|
|
||||||
Some resources need to change based on the user's locale, such as
|
Some resources need to change based on the user's locale, such as
|
||||||
translation files or icons. You can specify a locale in the
|
translation files or icons. You can specify a locale in the
|
||||||
\uicontrol Language field.
|
\uicontrol Language field.
|
||||||
|
|
||||||
|
Use a lowercase, two-letter \l {https://www.iso.org/iso-639-language-codes.html}
|
||||||
|
{ISO 639 language code}, such as \e de, \e en, or \e fr.
|
||||||
|
|
||||||
|
\section1 Remove resource files
|
||||||
|
|
||||||
Select \uicontrol Remove to remove the selected file from the resource
|
Select \uicontrol Remove to remove the selected file from the resource
|
||||||
collection. In the \uicontrol {Remove File} dialog, select the
|
collection.
|
||||||
|
|
||||||
|
In the \uicontrol {Remove File} dialog, select the
|
||||||
\uicontrol {Delete file permanently} check box to remove the file from
|
\uicontrol {Delete file permanently} check box to remove the file from
|
||||||
the file system. To remove files that cannot be found in the file system,
|
the file system.
|
||||||
|
|
||||||
|
\image qtcreator-remove-file.webp {Remove File dialog}
|
||||||
|
|
||||||
|
To remove files that cannot be found in the file system,
|
||||||
select \uicontrol {Remove Missing Files}.
|
select \uicontrol {Remove Missing Files}.
|
||||||
|
|
||||||
The above functions are also available in the context menu in the
|
The above functions are also available in the context menu in the
|
||||||
\uicontrol Projects view.
|
\l Projects view.
|
||||||
|
|
||||||
\section1 OpenGL Fragment and Vertex Shaders
|
\sa {Create files}, {Use project wizards}, {QLocale}
|
||||||
|
*/
|
||||||
|
|
||||||
Qt supports integration with OpenGL implementations on all
|
/*!
|
||||||
platforms, which allows you to display hardware accelerated 3D graphics
|
\page creator-how-to-create-opengl-shaders.html
|
||||||
alongside a more conventional user interface. For more information, see
|
\previouspage creator-how-tos.html
|
||||||
\l{Qt GUI}.
|
|
||||||
|
\ingroup creator-how-to-projects
|
||||||
|
|
||||||
|
\title Create OpenGL fragment and vertex shaders
|
||||||
|
|
||||||
|
Qt supports integration with OpenGL implementations on all platforms, so you
|
||||||
|
can display hardware accelerated 3D graphics alongside a more conventional
|
||||||
|
user interface. For more information, see \l{Qt GUI}.
|
||||||
|
|
||||||
You can use the QOpenGLShader class to compile OpenGL shaders written in the
|
You can use the QOpenGLShader class to compile OpenGL shaders written in the
|
||||||
OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language
|
OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language
|
||||||
(GLSL/ES). QOpenGLShader and QOpenGLShaderProgram shelter you from the
|
(GLSL/ES). QOpenGLShader and QOpenGLShaderProgram shelter you from the
|
||||||
details of
|
details of compiling and linking vertex and fragment shaders.
|
||||||
compiling and linking vertex and fragment shaders.
|
|
||||||
|
|
||||||
You can use \QC code editor to write fragment and vertex shaders
|
To create OpenGL shaders:
|
||||||
in GLSL or GLSL/ES. The code editor offers syntax highlighting and code
|
|
||||||
completion for the files.
|
|
||||||
|
|
||||||
\image qtcreator-new-opengl-file.png "New OpenGL file wizard"
|
\list 1
|
||||||
|
\li Select \uicontrol File > \uicontrol {New File} > \uicontrol {GLSL}.
|
||||||
|
\image qtcreator-new-opengl-file.png {New OpenGL file wizard}
|
||||||
|
\li Select the type of the shader to create, and then select
|
||||||
|
\uicontrol Choose.
|
||||||
|
\li Follow the instructions of the wizard to create the shader file.
|
||||||
|
\li Open the shader file in the code editor, and write the shader code
|
||||||
|
in GLSL or GLSL/ES. The code editor offers syntax highlighting and
|
||||||
|
code completion for the files.
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\sa {Create files}, {Use project wizards}
|
||||||
*/
|
*/
|
||||||
|
@@ -69,7 +69,7 @@
|
|||||||
install and configure some additional software on the devices to be able to
|
install and configure some additional software on the devices to be able to
|
||||||
\l{Connecting Devices}{connect} to them from the development PC.
|
\l{Connecting Devices}{connect} to them from the development PC.
|
||||||
|
|
||||||
\sa {Manage Projects}{How-to: Manage Projects}, {Creating Files},
|
\sa {Manage Projects}{How-to: Manage Projects},
|
||||||
{Adding Libraries to Projects}, {Opening Projects},
|
{Adding Libraries to Projects}, {Opening Projects},
|
||||||
{Adding New Custom Wizards}
|
{Adding New Custom Wizards}
|
||||||
*/
|
*/
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
\uicontrol Wizard. All wizard actions start with \uicontrol Impl there.
|
\uicontrol Wizard. All wizard actions start with \uicontrol Impl there.
|
||||||
|
|
||||||
\sa {Assign keyboard shortcuts}, {Activating Kits for a Project},
|
\sa {Assign keyboard shortcuts}, {Activating Kits for a Project},
|
||||||
{Creating Files}, {Creating Projects}
|
{Create files}, {Creating Projects}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
\list
|
\list
|
||||||
\li \l{Creating Projects}
|
\li \l{Creating Projects}
|
||||||
\list
|
\list
|
||||||
\li \l{Creating Files}
|
|
||||||
\li \l{Opening Projects}
|
\li \l{Opening Projects}
|
||||||
\li \l{Adding Libraries to Projects}
|
\li \l{Adding Libraries to Projects}
|
||||||
\li \l{Adding New Custom Wizards}
|
\li \l{Adding New Custom Wizards}
|
||||||
@@ -278,6 +277,10 @@
|
|||||||
\list
|
\list
|
||||||
\li \l {Add a license header template for C++ code}
|
\li \l {Add a license header template for C++ code}
|
||||||
\li \l {Add subprojects to projects}
|
\li \l {Add subprojects to projects}
|
||||||
|
\li \l {Create C++ classes}
|
||||||
|
\li \l {Create files}
|
||||||
|
\li \l {Create OpenGL fragment and vertex shaders}
|
||||||
|
\li \l {Create resource files}
|
||||||
\li \l {Develop Qt for Python applications}
|
\li \l {Develop Qt for Python applications}
|
||||||
\li \l {Select the build system}
|
\li \l {Select the build system}
|
||||||
\li \l {Specify project contents}
|
\li \l {Specify project contents}
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
\QC creates the necessary boilerplate files. Some of the files are
|
\QC creates the necessary boilerplate files. Some of the files are
|
||||||
specific to a particular target platform. You can use wizard templates
|
specific to a particular target platform. You can use wizard templates
|
||||||
also to \l{Creating Files}{add files} to the projects.
|
also to \l{Create files}{add files} to the projects.
|
||||||
|
|
||||||
\section1 Qt Quick Applications
|
\section1 Qt Quick Applications
|
||||||
|
|
||||||
|
@@ -77,7 +77,7 @@
|
|||||||
\if defined(qtdesignstudio)
|
\if defined(qtdesignstudio)
|
||||||
\l{Adding Files to Projects}.
|
\l{Adding Files to Projects}.
|
||||||
\else
|
\else
|
||||||
\l{Creating Files}.
|
\l{Create files}.
|
||||||
\endif
|
\endif
|
||||||
\li Rename existing files. To move the file to another directory, enter
|
\li Rename existing files. To move the file to another directory, enter
|
||||||
the relative or absolute path to its new location in addition to the
|
the relative or absolute path to its new location in addition to the
|
||||||
|
@@ -73,7 +73,7 @@
|
|||||||
\if defined(qtdesignstudio)
|
\if defined(qtdesignstudio)
|
||||||
\l{Adding Files to Projects}.
|
\l{Adding Files to Projects}.
|
||||||
\else
|
\else
|
||||||
\l{Creating Files}.
|
\l{Create files}.
|
||||||
\endif
|
\endif
|
||||||
\li Rename existing files. If you change the base name of a
|
\li Rename existing files. If you change the base name of a
|
||||||
file, \QC displays a list of other files with the same base name
|
file, \QC displays a list of other files with the same base name
|
||||||
|
Reference in New Issue
Block a user