Qt designer linux debian

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.

Источник

Programming Ua

програмування, programming, c#, javascript, sql, .net

29.07.16

Установка Qt на linux Debian. Install Qt on linux Debian, Ubuntu

Установка Qt на linux Debian.

1. Необходимо выполнить обновление списка репизитория и если необходимо добавить новые ссылки на источники, и выполнить апгрейд.

apt-get update
apt-get upgrade

2. Запускаем установку пакета t5-default, с установкой будут подтянуты необходимые зависимости.

apt-get install qt5-default

3. Далее устанавливаем qtcreator, который имеет большой размер, так как с ним устанавливается графическая среда.

apt-get install qtcreator

4. После завершения установки можно запускать среду разработки. Из командной строки набираем qtcreator, после чего будет запущена графическая среда.

5. В случае, если будут необходимы дополнительные компиляторы, то их можно установить дополнительно build-essential g++. В опциях выберем предпочтительный компилятор после этого QT 5 Compiler Set.

При установке столкнулся с проблемой нехватки места.

1. Просмотреть размер партиций.

2. Для легкого изменения размеров раздела можно воспользоватся gparted.(11 mb)

apt-get install gparted

3. В том случаи если если места не хватает, необходимо сделать очистку хранилища, кеш файлов, а также ненужных пакетов.

apt-get autoclean
apt-get autoremove

Надеюсь, описание решения возникших проблем при установке, будут полезны.

Источник

How to Write and Run your first Qt Program in Debian 10

Qt is a free, open source, and cross-platform application development framework for desktop, embedded and mobile. It supports various platforms such as Linux, OS X, Windows, VxWorks, QNX, Android, iOS, BlackBerry, Sailfish OS, and others. More than a programming language. Qt is a framework written in C++. A preprocessor, 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.

In this article, we will first describe how to install the Qt Creator through the command line. Then, we will explain how to write a simple Qt Hello World program and run it through:

  • The Command-line
  • The Qt Compiler GUI

We have run the commands and procedures mentioned in this article on a Debian 10 Buster system.

Installing the Qt Creator

Let us first start by installing the Build Essential that is a meta-package that lets you install and use C++ tools in Debian.

Open the Debian command line, the Terminal, either through the Application Launcher search bar as follows:

Then run the following command as sudo in order to update your local repository index with that of the Internet:

This command lets you install the latest available software packages available on the Internet.

Now, run the following command as sudo in order to install the Build Essential package:

Please note that only an authorized user can add, remove, update, and configure software on Debian. Please provide your password and enter Y when the system prompts you with a choice to continue the installation.

Next, run the following command as sudo in order to install the Qt Creator package that contains both the UI and command line tools for Qt project creation and execution. Advertisement

Please enter Y when the system prompts you with a choice to continue the installation.

If you want Qt 5 to be used as the default Qt Creator version, then run the following command:

Please enter Y when the system prompts you with a choice to continue the installation.

For deploying more complex projects later, you will need to install the Qt documentation and examples. You can do so by running the following command as sudo:

  • qt5-doc: This package contains the Qt 5 API Documentation.
  • qtbase5-examples: This package contains the Qt Base 5 examples.
  • qtbase5-doc-html: This package contains the HTML documentation for the Qt 5 Base libraries.

Please enter Y when the system prompts you with a choice to continue the installation.

You are now ready to use the Qt Creator command line and UI tools!

Your first Qt Program; Written and compiled from the Terminal

A Terminal-savvy person like me is always on a look out for finding solutions of all programming problems within the Terminal itself. It is afterall, very simple to write and compile Qt programs from the Debian command line. Please follow these steps in order to write and execute a simple program Qt program from the Terminal.

Step 1: Create a Project Directory

Let us first create a working directory that will later serve as a project directory for our Qt project.

You can, of course, choose the project and file names according to your own wishes. Just be consistent and careful with them as you follow the steps of this tutorial.

Step 2: Create a .cpp file in the project directory

Move to the newly created project directory through the following command:

Then, create a main .cpp file in this directory through the nano editor as follows:

You can, ofcourse, use any of your favorite text editors for this purpose.

In the blank file, copy this Qt program whose sole purpose is to print a line of sentence on a window with the title “My First Qt Program”.

Tip: You can copy this code by selecting it from here, and then paste it in the file by using the Ctrl+Shift +V shortcut. Alternatively, you can paste the selected test by using the Paste option from the right-click menu in the File.

Quit the file by using the Ctrl+X shortcut and then save it by entering Y, and then hitting Enter.

Step 3: Create the Qt project file

After saving the file, run the following command in order to create a Qt Project file:

Running the ls command will display that the above command has created a file by the name of SampleProject.pro in the project directory. This project file is the basic skeleton file for Qt projects and it can be edited for complex purposes.

Step 4: A little configuration to the Qt project file

As we want to compile out project from the command line, we will need to add the following line to our .pro file.

QT += gui widgets

Open the SampleProject.pro file in the nano editor as follows:

Add the above-mentioned like and Save the file by hitting Ctrl+X, and then by entering Y and hitting Enter.

Step 5: Run qmake to make the project platform-specific

To make the .pro file platform specific, you need to run the following command on the project file:

This will create a file by the name of “Makefile” in the project directory. You can verify this by running the ls command, just as I did.

Step 6: Create and Executable Qt File for the project

The following make command will help you in compiling the Makefile into an executable program.

Providing that there are no errors in your project, this command should create an executable program in your working directory. You can verify this by running the ls command, just as I did.

The SampleProject file, in green color, is my executable Qt program.

Step 7: Run the Executable file

Finally, we are ready to run the executable file we created in the last step through the Terminal. Run the following command to do so:

Here is the output of the program:

A window with a title and label that we provided in the code!

Your first Qt Program, compiled from the Qt Creator UI

If you are interested in executing the same program from the Qt Creator UI, please follow this procedure:

Launch the Qt Creator application either through the system Application Launcher search as follows, or directly through the Applications listing.

You can even launch it by entering the following command in your Terminal:

The application will open in the following view.

Create a new project by Clicking on the New Project button in the following Projects view:

This will open the New File or Project view as follows:

We will be choosing a template for our project here. Click on the Application option temp from the Project panel and select Qt Widgets Application as a template. This template creates a Qt application for the desktop. It includes a Qt Designer-based main window. Click on the Choose button after after making your selections; this will open the following Qt Widgets Application view:

Enter the name of your Qt project and specify the location where you want to create it. Then click Next; it will open the following view for you to make a Kit Selection:

Make sure that Desktop is selected as the kit, and then click Next. You will then be presented with the Class Information as follows:

You can, of course, change the class names according to your will but for your first Qt program, we prefer you use the default file names. Click Next and you will be presented with the following Project Management details:

Click the Finish button and you are ready to work on your first Qt project.

The Qt Creator will open your mainwindow.cpp file by default. Click on the main.cpp file from the Project hierarchy presented in the left-most panel. In the main.cpp file, replace the existing code with the following one:

This is how your project window should look like:

Save the file by using the Ctrl+S shortcut or by selecting Save from the File menu.

Finally, Run the project by using the Ctrl+R shortcut or by selecting Run from the Build menu.

Your program will be compiled and run, and you will be able to see the following output:

A window with our specified title and label!

So, this was all you needed to know in order to write, compile, and run your first Qt program. You can choose if the command line or the UI method suits you more, depending on your project needs and personal preference.

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

Источник

Читайте также:  Как сделать резервную копию драйверов windows 10 без стороннего по
Оцените статью