diff options
author | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2023-01-24 11:43:11 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-02-14 21:21:40 +0000 |
commit | 261624e2d44ce9db0cb81abb230942becdb32af8 (patch) | |
tree | 73a76d21f962f70c3e4814a5e348a44abdfbf2de | |
parent | d83b399d412375a0878b8023b8ea6fc115e98c70 (diff) |
Doc: Mention QDS and UI files in Best Practices
Developers can easily break QDS .ui.qml files if they edit them
as code. Link to the description of UI files in QDS Manual.
Fixes: QTBUG-110354
Change-Id: Id5dc0e9fd420e0e4807a39d4f8d7d121e5137636
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
(cherry picked from commit 5fabb872e0041aaf134b33e140d8f8512c31455b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc b/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc index abfff7cc11..8cd51a50c6 100644 --- a/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc +++ b/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc @@ -52,11 +52,16 @@ options that align with the latest UI design trends. If these UI controls do not satisfy your application's needs, only then it is recommended to create a custom control. +You can use the controls when you design UIs in Qt Design Studio. In addition, +it provides timeline-based animations, visual effects, layouts, and a +live-preview for prototyping applications. \section2 Related Information \list \li \l{Qt Quick Controls} +\li \l{Customizing Qt Quick Controls} \li \l{Qt Quick} +\li \l{Qt Design Studio Manual} \endlist \omit @@ -146,7 +151,7 @@ specific file managed by the resource system. For example, if we wanted to give \li \l{The Qt Resource System} \endlist -\section1 Separate UI from Logic +\section1 Separate UI from Business Logic One of the key goals that most application developers want to achieve is to create a maintainable application. One of the ways to achieve this goal is @@ -162,8 +167,8 @@ reasons why an application's UI should be written in QML: \li JavaScript can easily be used in QML to respond to events. \endlist -Being a strongly typed language, C++ is best suited for an application's logic. -Typically, such code performs tasks such as complex calculations +Being a strongly typed language, C++ is best suited for an application's +business logic. Typically, such code performs tasks such as complex calculations or data processing, which are faster in C++ than QML. Qt offers various approaches to integrate QML and C++ code in an application. @@ -326,6 +331,22 @@ see \l {Choosing the Correct Integration Method Between C++ and QML}. \li \l{Qt Quick Controls - Chat Tutorial}{Chat application tutorial} \endlist +\section1 Using Qt Design Studio + +Qt Design Studio uses UI files that have the filename extension \e {.ui.qml} +to separate the visual parts of the UI from the UI logic you implement in +\e {.qml} files. You should edit UI files only in the \uicontrol {2D} view in +Qt Design Studio. If you use some other tool to add code that Qt Design Studio +does not support, it displays error messages. Fix the errors to enable visual +editing of the UI files again. Typically, you should move the unsupported code +to a \e {.qml} file. + +\section2 Related Information + +\list + \li \l{Qt Design Studio: UI Files} +\endlist + \section1 Using Qt Quick Layouts Qt offers Qt Quick Layouts to arrange Qt Quick items visually in a layout. |