Qt——Summary of the method and steps of installing Qt Creator under Ubuntu and its interface functions and basic settings (Qt introduction, Qt Creator version selection, software introduction, common settings)

[Series of Columns]: Columns that solve practical problems output by bloggers combined with work practice, friends, check it out! 

"Project Case Sharing"

"Geek DIY Open Source Sharing"

"Embedded General Development Practice"

"Basic Summary of C++ Language Development"

"Learning Embedded Linux Development from 0 to 1"

"QT Development Practice"

"Android Development Practice"

"Practical Hardware Design"

"Structural Modeling Design"

"Database Development Summary"

"Basics of Getting Started with JAVA"

"JavaWeb Development Practice"

Continue to bring more cases and technical article sharing for a long time;

Welcome commercial project consultation, 10 years + full-stack internal strength of software and hardware, to help solve your noble needs.

Original link: https://winter.blog.csdn.net/article/details/129527522

——————————————————————————————————

Table of contents

 0 Preface

1 Introduction to Qt

2 Install Qt Creator under Ubuntu

2.1 Download Qt Creator

2.2 Installation steps under Ubuntu

3 Qt Creator software interface

3.1 Introduction to Qt Creator interface

3.2 Basic settings of Qt Creator

4 Summary


 0 Preface

        As an excellent cross-platform C++ development library, Qt is now more and more widely used. At the beginning, it was used more in the field of industrial control, and now it is used more and more in the field of consumption, smart home and other fields, such as ordering machines and temperature acquisition. Display, car instrument, etc., using Qt can design a GUI interface that makes customers shine. This blog post summarizes the steps of installing Qt Creator under Ubuntu, and finally makes a small example to demonstrate its use.

1 Introduction to Qt

        Qt is a cross-platform C++ development library, which is mainly used to develop Graphical User Interface (GUI) programs. In addition to drawing beautiful interfaces (including controls, layouts, and interactions), Qt also includes many other functions, such as Multithreading, database, image processing, audio and video processing, network communication, file operation, etc. Qt also has bindings for scripting languages ​​such as Python, Ruby, and Perl, that is, you can use scripting languages ​​to develop programs based on Qt.

        Qt supports many operating systems, such as general operating systems Windows, Linux, Unix, smart phone systems Android, iOS, WinPhone, embedded systems QNX, VxWorks and so on.

        Qt can do many things, and many software under Windows are also developed by Qt. Qt's cross-platform feature is very popular. "Cross-platform" means that the code developed on A platform can be used on other platforms without any modification or small modification. Run on the B platform.

2 Install Qt Creator under Ubuntu

2.1 Download Qt Creator

        Do a few Qt-based projects, and you will find that more effort has been put into the Qt design interface. It is not difficult to realize some system functions. To develop Qt, you need the corresponding integrated development environment Qt Creator. We can go to the official website to download it . Different Qt versions, as of March 10, 2023, the latest version has reached 6.4:

         It is not necessary to choose the latest version to choose the Qt version. Unless you see a new feature in the new version that is necessary for your project, otherwise it is best not to try something new. The latest version often has many unstable Factors, and the code developed with a higher version of Qt, and then switched to a lower version of Qt development environment, the compatibility may not be good, so when choosing a Qt version, it is recommended to choose a version supported by LTS for a long time. The blogger here chooses the Qt5.12.9 version

2.2 Installation steps under Ubuntu

Blogger's Ubuntu version: Ubuntu16.04

Qt version: Qt5.12.9

        We install it under Linux, and the downloaded package is qt-opensource-linux-x64-5.12.9.run, which can be imported into the VM virtual machine Linux environment after downloading under Windows, or copy the download link, and use the wget command in Ubuntu download:

wget https://download.qt.io/archive/qt/5.12/5.12.9/qt-opensource-linux-x64-5.12.9.run

After getting the installation package, grant executable permission and add sudo permission to enter the installation (installed in the /opt directory):

chmod +x qt-opensource-linux-x64-5.12.9.run
sudo ./qt-opensource-linux-x64-5.12.9.run

A bunch of next steps, the steps to agree to the agreement are omitted. Here we mainly look at the installed components:

        The gcc compiler must be installed, Sources is the Qt source code, and the modules below Source are some modules of Qt, you can choose to install or not. Here we choose full set.

        The above blog post mentioned Qt for a while, and Qt Creator for a while. In fact, the installation package we downloaded includes both the Qt source code library and the Qt Creator development environment. The Qt source code library is the library we need to rely on for development. Qt Creator is the integrated environment required for development and design. As shown in the figure above, the Qt Creator version supporting Qt5.12.9 is 4.12.2.

After installation, the directory where the software is located: /opt/Qt5.12.9/Tools/QtCreator/bin/

You can double-click qtcreator to start it, or you can see that there is a qtcreator.sh script in this folder, and you can enter the following command in the terminal to start it:

/opt/Qt5.12.9/Tools/QtCreator/bin/qtcreator.sh &

Open the interface and the installation is complete:

3 Qt Creator software interface

3.1 Introduction to Qt Creator interface

        After starting Qt Creator, the main interface of Qt Creator is as follows, and you can see that Qt Creator comes with many examples. In Ubuntu, because Qt Creator is installed in the /opt directory, ordinary users have no permission to write in this directory, and can only read it. If you want to open the example, click and select "Copy Project and Open".

        The interface design of Qt Creator is very simple. The most important thing is the "Help" button on the left side of Qt Creator. There are many instructions for use. If there is a certain method or class that is not clear, you can open the help button and search for reference to learn how to use it.

        Click the help menu -> UI Tour on the top toolbar, and the description of each component of Qt Creator will appear, explaining the functions of each part:

3.2 Basic settings of Qt Creator

        For general IDE development tools, we are used to setting according to our own habits. Qt Creator can also set font size, color and background color, etc., click Tools->Options in the menu bar:

Several common options are introduced:

1) Kits: It mainly displays the compilation tools. When installing Qt Creator in Ubuntu, the option Desktop Qt 5.12.9 GCC 64bit has been checked in the installation options, so the installed compilation tools can be detected on the Kits page. There are also items such as Qt Versions that can be viewed freely. The important thing is that we can configure the compilation tools of ARM platform in this Kits. The reason why Qt can be cross-platform is because Qt has compilation tools of different platforms.

​2
) Environment Environment: In this item, different themes and languages ​​can be set. Here we set the language to Chinese, and the software needs to be restarted to take effect:

​3
) Text editor: You can set the font size, color, etc. of the text editor. You can also set the font color for certain types,
such as keywords, strings, and comments.

​4
) Build and run: It is commonly used to set the directory of the project. Others generally do not need to be modified, the default is fine.

4 Summary

        This article records the installation steps of installing Qt Creator under Ubuntu, and repeats the step-by-step installation steps of the software without locking it, because the software installation steps are all the same, and only the key points are recorded. In addition, this article also introduces the interface composition of Qt Creator and the common basic settings. The next blog post will make a small routine to have a full understanding of how to use Qt Creator.

Worked on 202303141455, archived

———————————————————————————————————

This article is the blogger's original article, and it is not allowed to reprint without the blogger's permission!

If this article is helpful to you, gently raise your little hand to make a fortune , follow/comment/like/favorite , it is the greatest support for me!

I wish you a promotion and salary increase, and a prosperous future!

Guess you like

Origin blog.csdn.net/w464960660/article/details/129527522