- Game Programming Using Qt Beginner's Guide
- Witold Wysota Lorenz Haas
- 341字
- 2021-08-20 10:45:19
Summary
In this chapter, you learned how to create simple graphical user interfaces with Qt. We went through two approaches—creating user interface classes by writing all the code directly and designing the user interface with a graphical tool that generates most of the code for us. There is no telling which of the two approaches is better; each of them is better in some areas and worse in others. In general, you should prefer using Qt Designer forms to write code directly because it's faster and less prone to errors as most of the code is generated. However, if you want to retain more control over the code or your GUI is highly dynamic, writing all the code yourself will be easier, especially when you gain enough experience with Qt to avoid common pitfalls and learn to use advanced programming constructs.
We also learned how the heart of Qt—the meta-object system—works. You should now be able to create simple user interfaces and fill them with logic by connecting signals to slots—predefined ones as well as custom ones that you now know how to define and fill with code.
Qt contains many widget types but I didn't introduce them to you one by one. There is a really nice explanation of many widget types in the Qt manual called Qt Widget Gallery, which shows most of them in action.
If you have any doubts about using any of those widgets, you can check the example code and also look up the appropriate class in the Qt reference manual to learn more about them.
Using Qt is much more than just dragging-and-dropping widgets on forms and providing some code to glue the pieces together. In the next chapter, you will learn about some of the most useful functionalities that Qt has to offer; they do not relate to showing graphics on screen, but rather let you manipulate various kind of data. This is essential for any game that is more complicated than a simple tic-tac-toe.
- Visual Studio 2012 Cookbook
- Debian 7:System Administration Best Practices
- JavaScript+jQuery網頁特效設計任務驅動教程(第2版)
- PHP程序設計(慕課版)
- Spring Boot+Spring Cloud+Vue+Element項目實戰:手把手教你開發權限管理系統
- RTC程序設計:實時音視頻權威指南
- 精通軟件性能測試與LoadRunner實戰(第2版)
- 新編Premiere Pro CC從入門到精通
- Learning ArcGIS Pro
- Easy Web Development with WaveMaker
- 數據結構習題解析與實驗指導
- Python數據結構與算法(視頻教學版)
- Getting Started with LLVM Core Libraries
- Python一行流:像專家一樣寫代碼
- C++17 By Example