Reading guide
Qt is a cross-platform application and UI framework that can be used to write applications that are deployed across different desktops and embedded operating systems without having to rewrite the source code. Since the release of Qt 4.5, with Nokia continually developing more and more beloved product and experience strategic concepts, the QT product family continues to add new initiatives, new licensing options and new features to make Qt more open, easier and more convenient than ever.
Because of the extensive use of QT and the complexity of the learning process, many readers are apt to fall into confusion when they begin to learn and do not know where to start. Based on the knowledge characteristics and learning content, the author uses the latest QT version 4.5, combining his own experience of learning Qt and his experiences in engineering development, and meticulously authored this book. To help prepare readers who are learning to use QT for development, studying QT for engineering development, and using QT for engineering development, make less detours and improve the efficiency of learning and use.
The book according to the level of QT knowledge structure and the reader's Learning Law step-by-step, to explain. For each knowledge point in the book to explain, all strive to make readers not only "know", and "know Why". Only in this way can we really let the reader grasp the essence of knowledge and thus improve the ability of engineering practice. Finally, for most of the content of the book is combined with engineering practice to give detailed implementation code, and the practice of need to pay attention to the issues are also given a corresponding explanation or hint.
Features of the book
At the beginning of each chapter of this book are the key learning tips that the author points out, and almost every chapter contains tips and precautions to help you understand QT.
Most of the chapters in the book are in accordance with the "Stet by step" wizard-style narrative, so that readers in imitation of the rapid mastery of QT programming ideas and methods.
Each chapter of the book contains a number of carefully crafted examples to help readers learn related topics, each ending with practical questions and answers, providing additional information in the form of a single answer that may not be available from direct reading of the book. The final summary and improvement part is to comb and extend the content of this chapter, to help readers to master QT programming faster and better.
While authoring this book, the author tries to describe the QT programming in a concise way with easy and realistic examples.
The reader for the book
This book is written for QT program developers, college students and QT enthusiasts. The title of this book clearly shows that the main face of the beginner stage of the friends. In fact, the use of this book does not require a programming experience, readers can take this book as a learning program for the first step of the introductory textbook. The draft content of this book has been used by the author's undergraduate and postgraduate teams as QT programming handouts, with good results.
The authors suggest that the readership groups include:
★ There is no programming experience, the reader who wants to learn programming by learning QT
★ have mastered the C + + language, want to learn more about QT Programming readers
★ Beginner Programmer working on QT program development
★ Have a certain QT development experience, want the system to learn QT program reader
The content of this book is organized
The book does not cover all of QT's content, in fact Qt is so large that hardly any book can do that. According to his own experience, the author screened out the content that the beginner needs to master, as the focus of the book.
This book is divided into 13 chapters, in order to gradually, through the theoretical basis and examples of analysis of the application of QT development technology in detail. The contents of each section are described below.
The 1th chapter "approached Qt". Introduce the origins and development of QT, the overview of QT products, the composition and function of QT development tools, and the latest developments in QT. The focus is on a series of significant changes in Qt 4.5, and readers are asked to learn more about them in similar ways. For example, the difference between the LGPL protocol and the GPL, the difference between the commercial version and the open source version.
2nd Chapter "The installation and configuration of Qt". Describe how to install and configure Qt correctly and conveniently, and lay a solid foundation for the next application development. Content includes how to obtain QT, QT Authorization and protocol, install QT on the X11 platform, install QT on Windows platform, install QT on Mac OS x platform, Install the method of configuring QT on a common Linux distribution and how to configure Qt's environment variables, and so on. Installing and configuring QT is a basic skill, and readers must have a firm grasp of how to compile and install QT 4.
3rd chapter "QT Programming Foundation". Describes some basic knowledge and skills related to QT programming. It covers the three major platforms of Windows, Linux, and Mac OS X, including the basics of standard C + +, the programming mechanisms and principles of different platforms, the use of the VI editor, GCC, and gdb usage. Since QT is a large class library built on the basis of standard C + +, one of the main features is the convenience of cross-platform applications, so it is essential to master the basic knowledge and skills on different platforms.
4th Chapter "QT4 Integrated development Environment". This paper mainly introduces the mainstream IDE of QT 4 and the methods of installation and configuration. Is the so-called "工欲善其事, its prerequisite", proficient in the Qt4 IDE, will be able to prepare for the next development process well. This chapter includes general information about the common QT4 IDE, installation and configuration of Qt Creator, installation steps and configuration methods that are used in conjunction with QT 4, installation steps and Configuration methods that Visual studio uses with QT 4, and so on. The installation and configuration of Qt Creator is the key point that readers need to master.
The 5th chapter "using QT Basic GUI tool". The ability to use QT basic tools skillfully is a necessary skill. This chapter focuses on the usage and techniques of QT Designer, QT Assistant, and Qt demo, which are often not just a single tool to use in the development of QT applications, but often need to be used in a comprehensive way. More experience and methods also need readers to explore and summarize in practice constantly.
6th Chapter "Qt 4 program development method and process". After the previous chapters of the basic knowledge of learning, we have laid a solid foundation. Starting with this chapter, we're going to lead you really into the development of QT 4 applications. In this chapter, we introduce the basic steps of QT application compilation and the common 3 methods through the example of Hello qt!. They each have advantages and disadvantages. If you have just used QT, I want you to read through this chapter and try all 3 methods, focusing on the development process of QT application, the use of qmake, and a preliminary understanding of the signal/slot.
7th Chapter "dialog box". This chapter describes how to create an application based on a dialog box in Qt. The content mainly includes the inheritance relation of Qdialog class and its subclass, methods for using handwritten code subclasses to Qdialog classes, methods for creating dialog applications combined with QT Designer, how common QT standard built-in dialogs are used, modal dialog boxes and modeless dialogs, and how to use them. dialog boxes are one of the most common types of applications, so readers must be familiar with the basic methods and techniques for creating dialogs.
8th chapter "main Window". In this chapter, we'll show you how to create a main window application that includes the creation and use of menu bars, toolbars, status bars, actions, center parts, anchor parts, and so on. Finally, you will describe common methods and procedures for creating multiple document windows. For multiple-document applications, it is recommended that you use one of the 3 methods described in this chapter to be proficient.
9th chapter "QT Style sheet and application Impressions". This chapter describes the use of QT style sheets. Because of the introduction of the QT style sheet, customizing the appearance style of the Qt window widget becomes very simple. Whether you want to just change the look of an existing part, or to design a new style of interface from scratch, there's a new way to do it. This chapter includes ways to set the look and look of the application, how to integrate the style sheet with Qt Designr, how to subclass the Qstyle class, how to change the application's perception without using a stylesheet, and so on.
The 10th chapter "using. ui files in a program." This chapter explains how to integrate the. ui file into the QT 4 project. The main content includes the method of using the UIC, the composition of the Ui_yourformname.h file, the method of adding the processing. ui file at compile time, the method of adding processing. ui file, the method of realizing automatic association of signal and slot, etc. The focus is on understanding the composition and usefulness of ui_xxx.h files, and how to flexibly choose the most appropriate way to integrate. ui files, depending on the characteristics of the application.
11th chapter "Layout Management". Layout management is one of the most basic skills of QT program development. In this chapter, we explain the basic concept and classification of QT layout, the methods and steps of basic layout creation, the use of complex layout such as stack layout, split layout, and finally summarize the experience of layout management.
The 12th chapter "use QT Creator". Qt Creator is the preferred IDE in QT 4 application development. This chapter uses the form of the combination of pictures and texts to explain comprehensively the methods and steps of using QT Creator. These are the skills that are often used in project development and are expected to be mastered by the reader.
The 13th chapter "QT Core mechanism and principle". Signal and slot, Meta object system, event model is the core of QT mechanism, if you want to master QT programming, you need to have a more in-depth understanding of them. This chapter focuses on the basic concepts and usage of signal and slot, meta object system, QT event model, and some problems that should be paid attention to in the process of application.
Appendix A explains the common syntax of Qmake, which is a summary of the use of qmake in books.
Appendix B explains the common syntax of Make commands, and it is necessary to master make commands, especially when compiling commands are executed.
Appendix C is a summary of the author's collection of