About QT, you need to know these basics

Source: Internet
Author: User

QT was first developed by caused by parity, who was later acquired by Nokia and then bought by Digia. So some people would mistakenly think that Qt was born for the Symbian system, which is a product of backwardness.


But many embedded software and desktop tools are developed using QT, including Quartus and cadence, which are also useful to QT.

Of course, QT is similar to C #, Java, specifically for the development of graphical interface, then QT What is the special place. Here is a brief introduction.


1. What platform Qt can use.

The platform here refers to the operating system, not the CPU. QT can be used under Windows, Linux, Android, IOS, Mac OS, QNX, VxWorks.


Porting Linux to Arm is also a software that can be developed by running QT.


2, QT is open source, or charge.

is open source, need to follow LGPL, GPL agreement.


3. What language is QT used to develop?

It is recommended to use C + + to do business logic, the upper layer with QML do graphical interface. can also be pure C + + development, but the interface will be more tired.


4, what is QT Quick, what is QML, what is the relationship between the two.

QT Quick is just a technical name, it does not refer to any language in itself, but when others talk about QT quick, it means using QML to quickly develop a graphical interface.


QML is a hybrid language similar to CSS and Java script, which is very simple and easy to learn, and is suitable for people with little programming experience.


5, what is QT Creator.

Qt Creator is the official QT IDE, dedicated to the development of a graphical interface using the QT framework.


6, in addition to QT Creator, there is what IDE can be used.

At the moment, visual Studio, or VS, is more prevalent. Qt Creator can be used once it is installed, but vs is required to be set up.


7, the Qt creator native editor has Vi/vim mode.

There, called fake Vim, according to the following diagram settings can be.

8, beginners should learn which version of QT.

Should learn the latest QT5, the recommended textbook "Qt Creator QuickStart", "QT Quick core programming", and the official own English documents.


9, where to find the official QT documentation.

Open Qt Creator, as shown below, help, that's it.

There are some methods that are not written on the document, but actually exist. You need to take advantage of code completion.


10, what is PYQT.

PYQT is the use of the Python scripting language to invoke the QT framework to quickly develop a graphical interface. But the commercial use of PYQT, is to charge.


There is only one book on PYQT4-The PYQT Programming Guide, but now the newest is pyQt5.


Recommended "PYQT5 reference manual", "PyQt5 Tutorial".


11, I now only learn C, C + + syntax, do not do graphical interface, you can use QT Creator compile, run code.

OK. Qt creator comes with the MinGW compiler to compile C, C + +. But not all of the installation packages downloaded from the QT website, all with the MinGW compiler, you need to pay special attention when downloading.

When you create a new project, you can use the following project template.

12. How to develop 3D graphical interface using QT.

You can use Open GL, please refer to the QT OpenGL tutorial.


13, why casually write a Hello world, compiled out are 30 MB.

Because QT uses dynamic compilation by default, the compilation is very large. You can use the UPX compression shell.


14, how to use QT static compile code.

Please refer to "Qt5.9.0 MINGGW static compilation", it is recommended to download the existing static library.

Statically compiled files are very large, we recommend using the UPX compression shell.

Where, statically compiled Qt5.7.0, need to unload VC6.0, otherwise config however.


15, how to use QT release application.

If you compile dynamically, you can use the windeployqt that comes with Qt creator.

After dynamic compilation, you can use NSIs to make the installation package.

Static compilation, plus UPX compression shell, can be published, but also a single file.


16, how to put QT code, transplanted to arm.

You need to use the cross compiler arm GCC and set the hardware-related parameters.


17. Does QT use more than Android, OS X?

Not many, so it is not recommended to use QT to develop Android, OS x apps.


18, QT used in which places more.

Embedded development, desktop development.

19, where can download to QT.

https://www.qt.io/download-open-source/#section-2

Register your account on the website, log in, you can download qt on the above page.

If you do not want to register, you can also use the domestic mirror.

http://mirrors.ustc.edu.cn/qtproject/official_releases/qt/


20. What is the difference between QT4 and Qt5?

Qt4 a line of code to support Chinese globally, QT5 supports Chinese by default.

QT4 does not support serial port, need to use a third-party serial library, QT5 support serial port.

In addition, there are many differences between QT4 and QT5, which are not listed here.


21. What are the useful QT third-party libraries?

Third-party libraries, not officially developed by QT, but developed by other organizations.

More famous is the QWT library, using the QWT library, you can easily handle a variety of graphical interface, such as: Pie chart, oscilloscope map, Bode and so on.

However, Qt comes with qtcharts more useful than the QWT library. Qtcharts supports C + + and QML mixed programming, while QWT only supports C + +.

QWT has been a long time not updated, so, some people will use Qcustomplot, it is also a drawing of the third-party library.


22, where can browse the class of QT online.

Http://doc.qt.io/qt-5/classes.html


23. Where can I browse the type of QML online?

Http://doc.qt.io/qt-5/qmltypes.html


24, how to read the USB device information.

You can use the WIN32 API to capture USB messages (#include <windows.h>), or use LIBUSB.


25, which version of QT can support XP system.

Both Qt5.7.0 and previous versions can support XP. Qt5.7.0 can support XP directly, but it may pop up a warning.


26, how to set global shortcut keys, get global mouse coordinates.

Set global shortcut keys you can use third-party library Qxtglobalshortcut.

Get global mouse coordinates can be used qcursor::p OS ().


27, how to set the window shortcut keys, application shortcuts.

C + +, you can use the Qshortcut class, QML can use shortcut.

However, qshortcut and shortcut only use shortcut keys when the window or application is in focus, not the global shortcut key.


28, how to display the system tray.

Qt5.8 or later, you can use the QML Systemtrayicon, or use the C + + Qsystemtrayicon class.

Versions below Qt5.8 (not including 5.8) can only use the Qsystemtrayicon class of C + +.


29, QT Dynamic compilation files Too much, how to package into a file.

Use Enigma Virtual Box, but may be killed by anti-virus software.

Use NSIs to make the installation package.

Use the 14th static compilation.


30. What are the third-party libraries of C + +?

In addition to the libraries that C + + comes with (such as STL libraries), there are third-party libraries.

More famous is the boost library, which recommends the full development guide of the Boost library.


31, how to let Qt run a single instance process.

You can use Qtsingleapplication.


32, how to implement the command line program.

You can use Qcommandlineparser and qcommandlineoption.

Byte,short,int,long,float,double

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.