QT Introduction and QT Environment Construction

QT Introduction and QT Environment Construction

1. Introduction to QT

1. What is QT?

Qt is developed by Qt Company in 1991. 跨平台C++图形用户界面应用程序开发框架 It can be used to develop both GUI programs and non-GUI programs, such as console tools and servers . Qt is an object-oriented framework that uses special code generation extensions (called meta object compilers (Meta Object Compiler, moc)) and some macros. Qt is easy to extend and allows true component programming.

2. The history of QT

  • 1991–Haavard Nord and Eirik Chambe-Eng start to develop Qt that will support X11 and Windows
  • 1994–Qt Company was established
  • The 1996–KDE project was created by Matthias Ettrich (Matthias is currently working on the Nokia Qt development framework)
  • 1998 Apr 05 Trolltech programmers ported Netscape 5.0 from Motif to Qt within 5 days
  • 1998 Apr 08 KDE Free Qt Foundation established
  • 2000 Oct 30 Qt / Embedded began using the GPL declaration
  • 2000 Sep 04 Qt free edition started using GPL
  • 2008 Nokia acquired Qt from Trolltech and increased LGPL's licensing model
  • 2011 Digia acquired the commercial copyright of Qt from Nokia, and then Nokia is responsible for Qt on Mobile, and Qt Commercial is in charge of Digia
  • In April 2014, Digit's Qt development team announced the official release of Qt Creator 3.1.0.
  • On May 20, 2014, Digit's Qt development team announced the official release of Qt 5.3.
  • In 2019, the Qt team announced the release of the latest version 5.13.

3. QT supported platforms

Qt supports the following platforms:
MS / Windows-95, 98, NT4.0, ME, 2000, XP, Vista, Win7, win8, win2008, win10
Unix / X11 -Linux, SunSolaris, HP-UX, CompaqTru64 UNIX, IBMAIX, SGI IRIX, FreeBSD, BSD / OS and many other X11 platforms
Macintosh-Mac OS X
Embedded-Embedded Linux platform with framebuffer support, Windows CE, Symbian, Symbian ^ 3, Symbian Anna, Symbian Belle, MeeGo, haiku-os.

4. Advantages of QT

A, excellent cross-platform
Qt supports the following operating systems: Microsoft Windows,Linux,Solaris, SunOS, HP-UX, Digital UNIX (OSF/1,Tru64),Irix,FreeBSD,BSD/OS,SCO,AIX,OS390,QNX等等.

B.
The good encapsulation mechanism of object-oriented Qt makes Qt highly modular and reusable , which is very convenient for user development. Qt provides a security type called signals / slots to replace callbacks, making the collaboration between various components very simple.

C. Rich API
Qt includes more than 250 C ++ classes, and also provides template-based collections, serialization, file, I / O device, directory management, and date / time classes.

D. Support 2D / 3D graphics rendering and OpenGL

E. A large number of development documents

F, XML support

5. QT development tools

QT development tools included Qt Creator、Qt Designer、Qt Linguist、Qt Assistant、Qmake.

1. Qt Creator
Qt Creator is a lightweight cross-platform integrated development environment for Qt development.

2. Qt Designer
Qt Designer is a powerful drag-and-drop graphical user interface typesetting and design tool.

Qt Designer functions are as follows:

A. Support the creation of forms and dialogs, and preview them instantly

B. Integration with Qt layout system

C. The grand set of standard widgets

D. Support customized widgets and dialog boxes

E. Seamless integration with Microsoft Visual Studio .NET

The advantages of Qt Designer are as follows:

A. The design process of the interface is greatly accelerated.
B. The local look and feel on all platforms is supported.
C. Developers can fully utilize their existing skills in the working environment of their choice.

3. Qt Linguist
Qt Linguist is a set of tools that support quick and error-free translation of Qt applications. It is a set of tools that can streamline international workflow.

Qt Linguist features are as follows:

A. Collect all user interface texts and present them to human translators in a concise window

B. Support all languages

C. Provide simultaneous multi-language support and simultaneous multi-write system from within a single application binary program

The advantages of Qt Linguist are as follows:

A. Greatly speed up the translation / localization process

B. Collaborate with Qt's language-sensitive typesetting engine to create a concise and consistent interface that is not related to language

C, easy to deal with the international market

4. Qt Assistant
Qt Assistant is a customized and republishable help file and document reader.

Qt Assistant functions are as follows:

A. Simple and bright web browser-like navigation, bookmarks and document file connection

B. Support rich text HTML

C, full text keyword search

D. Can be customized and supplied with Qt

The advantages of Qt Assistant are as follows:

A. No need to build a help system from scratch

B. Make full use of existing HTML skills

C. Provide documents to end users in a format that facilitates search and navigation

5、Qmake

Qmake跨平台makefile生成器。

Qmake functions are as follows:

A. Read project source code, generate dependency tree, generate platform-related projects and makefiles

B. Integration with Visual Studio and Xcode

The advantages of Qmake are as follows:

A. No need to worry about cross-platform compilation

B. Reduce the need for manual construction of makefiles

5. QT module
QT module is divided into QT基础模块和QT扩展模块.

Second, QT environment construction (CentOS7)

Install QT5.9 (not on Xhsell, but on CentOS)

  1. download

What I chose here is qt-opensource-linux-x64-5.9.5.run

  • Use wget to download in Centos
wget http://download.qt.io/official_releases/qt/5.9/5.9.5/qt-opensource-linux-x64-5.9.5.run
  1. installation

  2. Pre-installed

yum -y install mesa-libGL-devel mesa-libGLU-devel freeglut-devel
  1. Then use go to root user to give executable permissions to the downloaded file
chmod +x qt-opensource-linux-x64-5.9.5.run
  1. Execute the file and install
./qt-opensource-linux-x64-5.9.5.run
  1. The interface-based installation process, the next down all the way, I just can't understand English. When you encounter login, you can choose to skip.

  2. Configure environment variables ( 所有的路径以自己安装QT的位置决定),This step is crucial! ! !
    所有的路径以自己安装QT的位置决定
    所有的路径以自己安装QT的位置决定
    所有的路径以自己安装QT的位置决定
    所有的路径以自己安装QT的位置决定
    所有的路径以自己安装QT的位置决定
    Add the path to /etc/ld.so.conf(root), see the picture below
    Insert picture description here
    /etc/ld.so.conf::

/home/wolf/Qt5.9.4/5.9.4/gcc_64/lib
/home/wolf/Qt5.9.4/Tools/QtCreator/lib
  1. ~/.bash_profile(root):
PATH=/home/wolf/Qt5.9.4/5.9.4/gcc_64/bin:/home/wolf/Qt5.9.4/Tools/QtCreator
												/bin$PATH:$HOME/bin
  1. Then set the PATH environment variable (root) to
    enter .bashrc, vim ~/.bashrc
    add after PATH:
/opt/Qt5.9.5/5.9.5/gcc_64/bin:/opt/Qt5.9.5/Tools/QtCreator/bin

Insert picture description here

  1. Make the configuration effective:
source ~/.bashrc
  1. Configure related command environment variables (qmake)
  • In /etc/profilewhich configuration (root):
#               
#export QTDIR=/home/wolf/Qt5.9.4/5.9.4/gcc_64
#             
#export PATH=$QTDIR/bin:$PATH
#
#export MANPATH=$QTDIR/man:$MANPATH
#
#export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
  • In ~/.bashrcthe configuration (general):
#export QTDIR=/home/wolf/Qt5.9.4/5.9.4/gcc_64
#
#export PATH=$QTDIR/bin:$PATH
#
#export MANPATH=$QTDIR/man:$MANPATH
#
#export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

都要source或者重启一下

Published 158 original articles · praised 117 · 90,000 views

Guess you like

Origin blog.csdn.net/wolfGuiDao/article/details/105444876