What is qt designer linux

Qt Documentation

Contents

Qt’s support for different Linux platforms is extensive and mature.

To download and install Qt for Linux, follow the instructions on the Getting Started with Qt page.

Supported Configurations

The following configurations are supported.

Distribution Architecture Compiler Notes
openSUSE 15.1 x86_64 GCC 5 or later, GCC 7, ICC 19.1
SUSE Linux Enterprise Server x86_64 GCC 5 or later, GCC 10
Red Hat Enterprise Linux 7.6 x86_64 GCC 5.3.1 via devtoolset-4
Ubuntu 18.04 x86_64 GCC 5 or later, GCC 9
Generic Linux x86 and x86_64 GCC (5 or later), ICC 18.x

Requirements for Development Host

The Qt installers for Linux assume that a C++ compiler, debugger, make, and other development tools are provided by the host operating system. In addition, building graphical Qt applications requires OpenGL libraries and headers installed. Most Linux distributions do not install all of these by default, but setting up a development environment is still straightforward.

Use the following commands to install the basic requirements for building Qt applications:

Debian/Ubuntu (apt-get)

Fedora/RHEL/CentOS (yum)

openSUSE (zypper)

Building Qt 5 from Source

You can also build Qt 5 from the source package and configure it according to your target platform. The source packages are obtained from http://www.qt.io/download/.

Below, you will find more information about building Qt from source.

Deployment and Other Issues

The pages below covers specific issues and recommendations for creating Linux/X11 applications.

Where to Go from Here

We invite you to explore the rest of Qt. We prepared overviews which help you decide which APIs to use and our examples demonstrate how to use our API.

  • Qt Overviews — list of topics about application development
  • Examples and Tutorials — code samples and tutorials
  • Qt Reference Pages — a listing of C++ and QML APIs
  • Qt X11 Extras — provides additional APIs for X11

Qt’s vibrant and active community site, http://qt.io houses a wiki, a forum, and additional learning guides and presentations.

В© 2021 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.

Источник

Qt Documentation

Contents

Qt’s support for different Linux platforms is extensive and mature.

To download and install Qt for Linux, follow the instructions on the Getting Started with Qt page.

Supported Configurations

The following configurations are supported.

Distribution Architecture Compiler Notes
CentOS Linux 8.1 x86_64 GCC 9
openSUSE 15.2 x86_64 GCC 9
SUSE Linux Enterprise Server 15 SP2 x86_64 GCC 10
Ubuntu 20.04 x86_64 GCC as provided by Canonical, GCC 9.x
Generic Linux x86 and x86_64 GCC 9

Requirements for Development Host

The Qt installers for Linux assume that a C++ compiler, debugger, make, and other development tools are provided by the host operating system. In addition, building graphical Qt applications requires OpenGL libraries and headers installed. Most Linux distributions do not install all of these by default, but setting up a development environment is still straightforward.

Use the following commands to install the basic requirements for building Qt applications:

Debian/Ubuntu (apt-get)

Fedora/RHEL/CentOS (yum)

openSUSE (zypper)

Building Qt from Source

You can also build Qt from the source package and configure it according to your target platform. The source packages are obtained from http://www.qt.io/download/.

Below, you will find more information about building Qt from source.

Deployment and Other Issues

The pages below covers specific issues and recommendations for creating Linux/X11 applications.

Where to Go from Here

We invite you to explore the rest of Qt. We prepared overviews which help you decide which APIs to use and our examples demonstrate how to use our API.

  • Qt Overviews — list of topics about application development
  • Examples and Tutorials — code samples and tutorials
  • Qt Reference Pages — a listing of C++ and QML APIs

Qt’s vibrant and active community site, http://qt.io houses a wiki, a forum, and additional learning guides and presentations.

В© 2021 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.

Источник

Создаём окружение для PyQt5 в Linux MInt (Ubuntu)


Давно уже до пятой версии обновился Qt и вместе с ним PyQt, но найти информацию по ним в русскоязычном сегменте — задача не из простых. Под катом подробный туториал для тех, кто только начинает знакомиться со связкой Qt + python3.

Цель: собрать и настроить окружение, пройти путь от установки PyQt5 и создания формы в Qt Designer до запуска переносимого бинарника под Windows (да, всё верно, разрабатываем под Mint, собираем для linux и windows).

Пути установки

/dev/
Мы будем использовать виртуальные окружения для питона, и хранить их будем в директории envs, т.е.

/dev/envs/
Наши проекты будут храниться в директории src, т.е.

/dev/src/

Если у вас уже сложилась собственная иерархия размещения файлов, то придётся скорректировать пути в командах, приведённых ниже.

Настройка окружения

Создаём структуру директорий. Откройте консоль и выполните:

Ставим пакет, который потребуется нам для сборки в будущем:

Ставим pip и virtualenv:

Создаём виртуальное окружение, активируем его и обновляем пакеты:

Ставим Qt5. При выборе пути установки я оставил «по-умолчанию»

/Qt. Если Вы выберите другой, то необходимо менять пути в командах ниже:

Ставим SIP — модуль, необходимый для работы PyQt:

На этом всё. Окружение установлено и готово к работе. Для проверки выполните команду:

Ответ должен выглядеть следующим образом:

Для проверки, что всё действительно установилось в виртуальное окружение, откройте новое окно терминала и повторите команду проверки:

В ответ должна появиться ошибка ImportError. Новое окно терминала после этого можно закрыть.

Создание приложения

Перейдём в директорию с нашими исходниками и создадим директорию проекта:

Далее нам потребуется Qt Designer. Если Вы не меняли пусть установки Qt, то запустить его можно командой:

Вот так выглядит запущенный Qt Designer на моей системе:

В данном руководстве я не буду подробно останавливаться на описании интерфейса дизайнера, мы пройдём простейший путь до минимальной готовой формы. Если Вам необходима более подробная информация — Google It!

В диалоговом окне выбираем «Widget» (последний пункт в списке «templates/forms») и нажимаем кнопку «Создать». Откроется форма редактирования виджета:

Перетащите на форму кнопку из меню слева и сохраните полученную форму с именем test.ui в директорию

/dev/src/pyqt_test/:

Tips&Tricks: Нажав [Crtl + R] Вы можете запустить свою форму и «потрогать» её в режиме реального времени.

Конвертируем файл интерфейса из XML формы в понятную python форму:

Я не хочу редактировать что-либо в файле, созданном конвертером PyQt, поэтому наши слоты мы опишем в отдельном файле. Создайте файл test_slots.py и откройте его в любимом Вами редакторе. Наполнение файла должно выглядеть примерно так:

Затем, создайте ещё один файл с именем main.py, в котором мы опишем основную логику:

На этом наше приложение завершено. Выполнив из консоли

мы должны увидеть форму с кнопкой посередине, нажатие на которую меняет название кнопки на системную дату.

Упаковка в исполняемый файл для Linux

Упаковщик потребует некоторой магии при установке.
Скачиваем пакет, не устанавливая его и распаковываем:

Открываем любимым редактором файл cx_Freeze-4.3.4/setup.py. Я использую SublimeText:

Правим строку №84, чтобы она выглядела, как на картинке:

Tips&Tricks: А вы знали, что если запустить SublimeText из виртуального окружения, то интерпретатором по-умолчанию будет из виртуального окружения?

Сохраняем изменения, закрываем редактор, устанавливаем пакет, возвращаемся в папку с исходниками, запускаем упаковку:

После этого в директории с исходниками появится директория dist, в которой среди множества файлов можно заметить файл без расширения main — это и есть наш бинарник, готовый для запуска и переноски. Откровенно говоря, немного расстраивает размер дистрибьютива: на моей машине это — 70,1 Мб, но не стоит забывать, что туда упакованы: python, PyQt, Qt и некоторые общесистемные библиотеки. Сборочный скрипт cxfreeze достаточно гибко конфигурируется, но подбор оптимальных параметров я оставлю на совести читателя. Скажу только, что счастье кроется в сжатии, оптимизации и ручном ограничении зависимостей.

Упаковка в исполняемый файл для Windows

К сожалению, чуда не будет. Мне не известен способ собрать exe напрямую из-под Linux-системы. Поэтому, придётся потанцевать с wine.
Закрываем открытый в самом начале терминал:

Открываем новый, ставим последнюю версию wine:

После этого скачиваем windows-версии уже знакомых нам пакетов и запускаем установку из-под wine:

А дальше немного магии. Идём по ссылке:

Качаем актуальную версию cx_Freeze для нашего интерпретатора и ставим поверх официальной:

После этого остаётся проверить работоспособность. Переходим в каталог с исходником, открываем терминал wine, выполняем уже знакомую команду сборки:

Оказалось, что у меня в распоряжении нет windows-машины, поэтому смог протестировать результат только под wine. Выходим из терминала wine (команда exit), закрываем терминал. Идём раздавать нашу программу всем желающим.

Источник

About Qt

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

Contents

What is Qt?

Qt is a cross-platform application development framework for desktop, embedded and mobile. Supported Platforms include Linux, OS X, Windows, VxWorks, QNX, Android, iOS, BlackBerry, Sailfish OS and others.

Qt is not a programming language on its own. It is a framework written in C++. A preprocessor, the MOC (Meta-Object Compiler), is used to extend the C++ language with features like signals and slots. Before the compilation step, the MOC parses the source files written in Qt-extended C++ and generates standard compliant C++ sources from them. Thus the framework itself and applications/libraries using it can be compiled by any standard compliant C++ compiler like Clang, GCC, ICC, MinGW and MSVC.

The Qt Company and The Qt Project

Development of Qt was started in 1990 by the Norwegian programmers Eirik Chambe-Eng and Haavard Nord. Their company, Trolltech, that sold Qt licenses and provided support, went through several acquisitions over the years. Today former Trolltech is named The Qt Company and is a wholly owned subsidiary of Digia Plc., Finland. Although The Qt Company is the main driver behind Qt, Qt is now developed by a bigger alliance: The Qt Project. It consists of many companies and individuals around the globe and follows a meritocratic governance model.

Everyone who wants to, individuals and companies, can join the effort. There are many ways one can contribute to the Qt Project, e.g. by writing code or documentation for the framework, reporting bugs, helping other users on the forum or maintaining pages on this wiki (see also http://qt.io/contribute/).

License

Qt is available under various licenses: The Qt Company sells commercial licenses, but Qt is also available as free software under several versions of the GPL and the LGPL (Licensing FAQ).

Build System

Although any build system can be used with Qt, Qt brings its own qmake. It is a cross-platform frontend for platform-native build systems, like GNU Make, Visual Studio and Xcode.

CMake is also a popular alternative to build Qt projects, Qt 4 support has been integrated years ago and Qt 5 provided support early.

A new player entered the game recently: The Qt Build Suite a.k.a Qbs. Qbs is a QML based build system which also provides support for Javascript. This build system not only provides building capability but also packaging like cmake.

Qt comes with its own Integrated Development Environment (IDE), named Qt Creator. It runs on Linux, OS X and Windows and offers intelligent code completion, syntax highlighting, an integrated help system, debugger and profiler integration and also integration for all major version control systems (e.g. git, Bazaar). In addition to Qt Creator developers on Windows can also use Qt’s Visual Studio Add-in. Other IDEs (e.g. KDevelop on KDE) can also be used. But of course it is in no way mandatory to use any IDE at all.

Internationalization and Localization

Qt features excellent support for internationalization (i18n) and localization (l10n). The tool Qt Linguist and its companions lupdate, lrelease and lconvert make it easy to translate applications to locale languages. Qt supports most languages and writing systems that are in use today. For a complete listing see the corresponding manual pages.

Widgets

With Qt, GUIs can be written directly in C++ using its Widgets module. Qt also comes with an interactive graphical tool called Qt Designer which functions as a code generator for Widgets based GUIs. Qt Designer can be used stand-alone but is also integrated into Qt Creator.

QtQuick

Another way to write GUIs with Qt is to use the QtQuick module. GUIs using QtQuick are written in QML. QML is a declarative object description language that integrates Javascript for procedural programming. QtQuick provides the necessary modules for GUI development with QML. It is possible to write whole applications in QML only, but usually only the GUI is written in QML and the application’s backend is implemented in C++ (see Integrating QML and C++). Also Qt Creator features an integrated QtQuick GUI designer and profiler.

More Modules

Qt is far more than a GUI toolkit. It provides modules for cross-platform development in the areas of networking, databases, OpenGL, web technologies, sensors, communications protocols (Bluetooth, serial ports, NFC), XML and JSON processing, printing, PDF generation, and much more.

For a full list of official Qt modules, see the All Modules page in the Qt documentation.

Also, see Inqlude.org for a list of 3rd-party modules based on Qt, for use in Qt projects.

Language Bindings

Although applications using Qt are usually written in C++ and QML bindings to other languages exist. These are not part of Qt but are provided by various third parties. Riverbank Computing for example provides commercial and free software Python bindings (PyQt). For more language bindings see Category:LanguageBindings.

Источник

Читайте также:  Linux как отключить тачпад
Оцените статью