The path to Qt Learning (1): Preface

Source: Internet
Author: User

Qt is a famous C ++ library. It may not be said that it is just a GUI library, because Qt is very large and not just a GUI. Using Qt, you get a "one-stop" service in a certain program: you no longer need to study STL or C ++ <string>, because Qt has its own QString and so on. This may be challenging, but Qt is indeed a "great C ++ library ".

The Qt we use is precisely the GUI programming part. C ++ GUI programming is different from Java: GUI is not part of the C ++ standard. Therefore, if you use Java, you 'd better choose AWT/Swing or SWT/JFace. However, the GUI programming of C ++ gives you more options: wxWidget, gtk ++, and Qt. I have been in touch with these databases, but there are not many contacts. I can only talk about the differences between them based on some materials and my own Superficial Understanding (PS: for more details, see the previous article ).

WxWidget is a standard C ++ library, which is as large as Qt. Its Syntax looks similar to that of MFC, with a large number of macros. It is said that an MFC programmer can easily switch to wxWidget. WxWidget has a major advantage, that is, its interfaces are all native. This is not what other libraries can do. WxWidget is highly efficient, and is said to be comparable to Microsoft's own MFC on Windows platforms.

Gtk ++ is actually a C library. However, due to the relationship between C ++ and C, this is not very relevant. However, gtk ++ is an example of implementing Object-Oriented Programming elegantly using the C language. However, this also brings about a problem-it carries a large number of type conversion macros to simulate polymorphism, and its function name is "Smelly and long (but I don't think so, because its function name is long but clear)", which uses underscores to separate words, it looks exactly the same as Linux. Because it is implemented in C language, its running efficiency is of course nothing. Gtk ++ is not a simulated Native Interface, but has its own style, so sometimes it seems incompatible with the operating system interface.

Let's take a look at Qt. Like wxWidget, it is also a standard C ++ library. However, its syntax is very similar to the Swing of Java, which is very clear, and the SIGNAL/SLOT mechanism makes the program look very clear-this is also a very important aspect of my first choice of Qt, because I was born from Java :). However, although this mechanism is clear, the consequence of it is that you need to use qmake of Qt to pre-process the program, to use make or nmake for compilation. And its interface is not native style, although Qt uses the style mechanism to simulate the local interface very cleverly. It is also worth mentioning that Qt is not only running in the desktop environment, but has been acquired by Nokia, it has now become the main interface technology of the Symbian series-Qt can run on embedded platforms.

In the past, many people criticized Qt authorization. Because the commercial version of Qt is expensive, the open-source version uses the GPL protocol. However, the open source protocol of Qt has now become LGPL. This means that you can connect Qt as a library to a closed-source software. It can be said that the current dispute over the Qt protocol does not exist-Because wxWidgets or gtk + are also published using similar protocols.

In this series of articles, we will use Qt4 for C ++ GUI development. I learned from C ++ GUI Programming with Qt4. Actually, I am just a beginner in Qt4. Here I will write down this learning note, hoping that it will help more friends learn Qt4. I am a Java programmer. I feel that some naming rules and constraints of Qt4 are similar to those of Java, so it is not difficult to migrate from Java to Qt4. However, this is mainly because Qt4 is well designed.

If you want to talk less, start the following study as soon as possible!

This article is from the "bean space" blog, please be sure to keep this source http://devbean.blog.51cto.com/448512/193918

Related Article

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.