Инструменты пользовательского интерфейса Qt
Формы Qt Designer обрабатываются во время выполнения для создания динамически генерируемых пользовательских интерфейсов. Для создания формы во время выполнения необходим файл ресурсов, содержащий файл пользовательского интерфейса. Приложения, которые используют классы обработки форм, необходимо сконфигурировать для построения с использованием модуля Qt UI Tools. Это делается путем включения следующего объявления в файл проекта qmake , чтобы гарантировать, что приложение скомпилировано и правильно скомпилировано.
QT += uitools
Объект загрузчика формы, предоставляемый классом QUiLoader , используется для создания пользовательского интерфейса. Этот пользовательский интерфейс можно получить с любого QIODevice . Например, объект QFile можно использовать для получения формы, хранящейся в ресурсах проекта. Функция QUiLoader :: load () берет описание пользовательского интерфейса, содержащееся в файле, и создает виджет формы.
Для включения определений классов модуля используйте следующую директиву:
#include
Лицензии и атрибуции
Инструменты пользовательского интерфейса Qt доступны по коммерческим лицензиям от The Qt Company . Кроме того, он доступен по лицензии бесплатного программного обеспечения. Начиная с Qt 6.0, эти лицензии на свободное программное обеспечение — это GNU Lesser General Public License, версия 3 , или GNU General Public License, версия 2 . Дополнительные сведения см. в разделе Лицензирование Qt .
API Reference
Это ссылки на справочные материалы API.
Examples
Qt 6.2
Избегайте фиксированных тайм-аутов
Избегайте использования жестко запрограммированных тайм-аутов, таких как QTest::qWait(), чтобы некоторые условия стали истинными.
Модуль Qt Test предоставляет классы для модульного тестирования приложений и библиотек.
Виртуальная клавиатура Qt
Проект Qt Virtual Keyboard предоставляет структуру ввода и эталонный фронтенд для 6 целей Linux Desktop/X11,Windows Boot2Qt.
Макеты виртуальной клавиатуры Qt
Виртуальная клавиатура поддерживает следующие языки:Чтобы добавить поддержку дополнительного языка,см.раздел Добавление новых раскладок клавиатуры.
Qt Designer Manual
Qt Designer is the Qt tool for designing and building graphical user interfaces (GUIs) with Qt Widgets. You can compose and customize your windows or dialogs in a what-you-see-is-what-you-get (WYSIWYG) manner, and test them using different styles and resolutions.
Widgets and forms created with Qt Designer integrate seamlessly with programmed code, using Qt’s signals and slots mechanism, so that you can easily assign behavior to graphical elements. All properties set in Qt Designer can be changed dynamically within the code. Furthermore, features like widget promotion and custom plugins allow you to use your own components with Qt Designer.
Note: You have the option of using Qt Quick and Qt Design Studio for user interface design rather than widgets. It is a much easier way to write many kinds of applications. It enables a completely customizable appearance, touch-reactive elements, and smooth animated transitions, taking advantage of hardware acceleration.
If you are new to Qt Designer, you can take a look at the Getting To Know Qt Designer document. For a quick tutorial on how to use Qt Designer, refer to A Quick Start to Qt Designer.
Table of Contents
- A Quick Start to Qt Designer
- Qt Designer’s Editing Modes
- Widget Editing Mode
- Signals and Slots Editing Mode
- Buddy Editing Mode
- Tab Order Editing Mode
- Customizing Qt Designer Forms
- Using Custom Widgets with Qt Designer
- Creating Custom Widgets for Qt Designer
- Creating Custom Widget Extensions
- Qt Designer’s UI File Format
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.
Development Tools
Qt is designed for developing applications and user interfaces once and deploying them across several desktop and mobile operating systems.
The easiest way to start application development with Qt is to download and install Qt. Qt installations contain Qt libraries, examples, documentation, and the necessary development tools, such as the Qt Creator integrated development environment (IDE). For more information, visit the Getting Started with Qt page.
Qt Creator
Qt Creator provides you with tools for accomplishing your tasks throughout the whole application development life-cycle, from creating a project to deploying the application on the target platforms. Qt Creator automates some tasks, such as creating projects, by providing wizards that guide you step-by-step through the project creation process, create the necessary files, and specify settings depending on the choices you make. Also, it speeds up some tasks, such as writing code, by offering semantic highlighting, checking code syntax, code completion, refactoring actions, and other useful features.
Design Tools
Qt Designer is a tool within Qt Creator for designing and building graphical user interfaces (GUIs) for Qt Widgets. You can compose and customize your widgets or dialogs in a visual editor, and test them using different styles and resolutions. Qt Designer is also available as a standalone tool. Both versions of Qt Designer only differ in some functionalities such as the use of resource files and how to switch in the design and edit mode. For more information, visit the Qt Designer manual.
Collaboration with Designers
Qt lets designers import assets from imaging and design tools, such as Adobe Photoshop, Sketch, Figma, Blender, or Maya, create layouts and flows, and generate code for developers. Qt Design Studio is a tool that provides rich and fluid components, a code editor, timeline-based animations, visual effects, layouts, and a live-preview for prototyping. Qt Design Studio generates code for developers to use in Qt Creator. For more information about the tools for designers, visit the Qt Design Studio manual.
Build Tools
Qt Creator creates project templates for different build systems. You can create kits for different combinations of target platforms and build environments. Qt Creator supports CMake, qmake, Qbs, Autotools, Nimble, Meson, and IncrediBuild projects.
For more information about project templates and building in Qt Creator, see:
- Qt Creator: Build Systems
- Qt Creator: Building for Multiple Platforms
Configuring and Building Qt
You can configure and build Qt from source using CMake or qmake. Custom configurations are for developers of Qt and for porting Qt to different targets. The Qt Platform Abstraction is an abstraction layer to facilitate Qt ports onto different platforms and targets.
For more information about building Qt, see:
- Build with CMake
- qmake Manual
- Qt Platform Abstraction
- Supported Platforms
Internationalization and Help Tools
You can localize your application to different languages. Use the Qt internationalization framework for handling different writing systems, translating interfaces, and for displaying numbers, dates, and currency in different formats. Qt Linguist is a tool for translators for translating applications. Together with release managers and developers, they produce, store, and deploy translated text in the UI.
For more information about internationalization and localization, see:
- Internationalization with Qt
- Qt Linguist
- Writing Source Code for Translation
You can use the Qt Help framework to create and package help files for complex applications. The help framework involves XML-based formats and tools to create content, set the order and filters for application manuals.
- The Qt Help Framework
- Qt Help C++ module
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.
При подготовке материала использовались источники:
https://runebook.dev/ru/docs/qt/qtuitools-index
https://doc.qt.io/qt-6/qtdesigner-manual.html
https://doc.qt.io/qt-6/topics-app-development.html