The way of Qt Learning (1): Preface

Source: Internet
Author: User
Tags gtk

The QT that we use, exactly, is its GUI programming part. C + + GUI programming differs from Java: The GUI is not part of the C + + standard. So, if you're using Java, your best bet is awt/swing, or you can make swt/jface, but GUI programming in C + + gives you more options: Wxwidget, gtk++, and Qt. These libraries I have contact, but contact is not a lot, can rely on some information and their own little superficial understanding of the difference between them (PS: More detailed comparison in the previous article).

First of all, Wxwidget, this is a standard C + + library, as large as QT. Its syntax looks similar to MFC and has a large number of macros. It is said that an MFC programmer can easily switch to wxwidget. Wxwidget has a great advantage, is that its interface is native style. 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, but because of C + + and C relationship between, this does not have a big relationship. However, gtk++ is an elegant example of object-oriented programming using the C language. However, this also poses a problem--it has a large number of type-converted macros that simulate polymorphism, and its function name "is smelly and long (but I do not think it is, because its function name is very long, but also very clear)", use the underline to split the word, looks like Linux. Because it is a C language implementation, it is certainly not a very efficient operation. Gtk++ is not a simulated native interface, but it has its own style, so sometimes it will be incompatible with the interface of the operating system.

To look at Qt, like Wxwidget, it is also a standard C + + library. But its syntax is very similar to that of Java swing, very clear, and the Signal/slot mechanism makes the program seem clear--which is one of the most important aspects of my choice of QT, because I am a Java-born:). However, the so-called "Chengye, Shenya", although this mechanism is clear, but the result is that you need to use QT Qmake to preprocess the program before you can use make or nmake to compile. And its interface is not native style, although Qt uses the style mechanism to simulate the local interface very cleverly. Also worth mentioning is that QT is not only running in the desktop environment, QT has been acquired by Nokia, it has now become the Symbian series of the main interface technology--QT is able to run on the embedded platform.

In the past, there has been much criticism of QT's mandate. Because the commercial version of QT is expensive, the open source version uses the GPL protocol. But now QT's Open source protocol has become LGPL. This means that you can connect Qt as a library to a closed source software. Arguably, the current issue of the QT protocol is no longer available-because wxwidgets or GTK + also use similar protocols.

In this series of articles, we will use QT4 for the development of the C + + GUI. I am referring to the "C + + GUI programming with Qt4" a book to learn. In fact, I am also just a beginner Qt4, here will be the study notes down, hoping to facilitate more friends to learn Qt4. I'm a Java programmer, and I feel Qt4 's naming conventions and constraints are similar to Java's, so migrating from Java to Qt4 doesn't seem to be very difficult. However, this is mainly because Qt4 good design and so on.

Gossip less, or start the following study as soon as possible!

Source: http://devbean.blog.51cto.com/448512/193918

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.