My QT5 learning path (1) -- Talking about the installation and configuration of QT, qt5qt
I. Preface
Speaking of Qt, C ++ is a great language. Because of its object-oriented programming ideas and steep learning curves, it was very difficult to learn at the beginning. Qt has basically encapsulated many C ++ tool libraries and interface libraries since QT4, and supports cross-platform, which is its biggest advantage. Compared with the ancient MFC and C # WPF, I prefer Qt for C ++ interface design, which is why I picked up the path of Qt learning from the beginning.
After talking about the feelings and learning reasons, we will begin to introduce Qt5. I will only give a brief introduction here. What is important is to understand the Qt programming logic and design ideas during the learning process.
Qt, to be honest, is not just an interface library. It is a set of C ++ programming ideas. It is a well-developed C ++ application framework. To some extent, using Qt is a "one-stop" and "all-around" solution, STL. String, XML, database, and network are all contained in Qt and encapsulated for use by developers.
There are usually three implementation strategies for cross-platform GUI:
Like wxWidgets, Qt is also a standard C ++ library. However, its syntax is similar to Java's Swing, which is very clear and uses the signal/slot mechanism, make the program seem clear-this is also a very important reason for many people to prioritize Qt. However, the so-called "success or failure ". Although this mechanism is clear, the consequence of this mechanism is that you need to use the moc of Qt to pre-process the program before using standard make or nmake for normal compilation, in addition, the call of the signal slot is about one order of magnitude slower than that of common function calls (this data is described in Qt 4, but Qt 5 has not been officially described ). The Qt interface is not a native style, although Qt uses the style mechanism to simulate the Native Interface very cleverly. It is also worth mentioning that Qt can not only run in the desktop environment, but also on embedded platforms and mobile platforms.
The first version of Qt was released by Trolltech in 1991. Later, in 2008, Nokia spent $0.15 billion to acquire TrollTech and applied Qt to Symbian program development. In August 9, 2012, Nokia sold Qt to Digia for 4 million euros.
Along with Qt, there have been two kinds of authorization protocols: Commercial authorization and open-source authorization. In early versions of Qt, commercial authorization includes components not provided by open-source authorization, but this issue does not exist in recent versions. In the past, many people criticized Qt's open-source authorization. Earlier versions of Qt used protocol authorization that is not compatible with GPL, which directly led to the war between KDE and GNOME (since Linux was released using the GPL protocol, the GPL protocol is contagious, as a Linux desktop environment, KDE is developed based on Qt that is incompatible with GPL, which does not comply with the GPL protocol ). However, currently, open-source versions of Qt use GPLv3 and LGPL protocols. This means that you can connect Qt as a library to a closed-source software. It can be said that the dispute over the Qt protocol no longer exists.
Ii. installation and configuration of Qt
2.1 Qt Installation
The above are two types of Qt, the first is the Qt for mingw compilation and debugging development, and the second (in the Red Line) is the Qt for msvc, that is, vs debugging and compilation. We recommend that you install the first method, including the gcc compiler and gdb debugger. The installation process will not be mentioned, just a green light, the status after installation is as follows.
2.2Qt Project Creation
Keep going. In the middle of the process, you can change the project name and file name until the following figure is displayed, that is, the project is created successfully.
Is a created Project, which can be run.
2.3 Qt Configuration
Here we will talk about the configuration of mingw. In addition, the compiler and debugger of msvc Qt are both msvc (my specific version is MSVC2013 ).
I use 32bit, and all compilers and debuggers are included in the kit, so you do not need to download them separately.
Okay. Now that you have finished your work at Qt, you can start learning.