In this chapter, we will explore Qt's graphics capabilities. The cornerstone of Qt's 2D drawing engine is QPainter, which can be used to draw on a widget on the screen, on an off-screen pixmap, or on a physical printer. Qt also includes a QCanvas class that provides a higher-level way of doing graphics, using an item-based approach that can efficiently handle thousands and thousands of items of various shapes. Many predefined items are provided, and it is easy to create custom canvas items.
An alternative to QPainter and QCanvas is to use the OpenGL library. OpenGL is a standard library for drawing 3D graphics, but it can also be used for drawing 2D graphics. It is very easy to integrate OpenGL code into Qt applications, as we will demonstrate.
Part I: Basic Qt
Getting Started
Creating Dialogs
Creating Main Windows
Implementing Application Functionality
Creating Custom Widgets
Part II: Intermediate Qt
Layout Management
Event Processing
2D and 3D Graphics
Drag and Drop
Input/Output
Container Classes
Databases
Networking
XML
Internationalization
Providing Online Help
Multithreading
Platform-Specific Features