In this chapter we introduce the idea of reflection, the self-examination of an object's members. Using reflective programming, it becomes possible to write general-purpose operations that work on classes of varied structures. Using QVariant, a generic value-holder, we can operate on built-in types as well as other common types in a uniform way.
15.1 |
Anti-patterns |
342 |
15.2 |
QMetaObject: The MetaObject Pattern |
344 |
15.3 |
Type Identification and qobject_cast |
345 |
15.4 |
Q_PROPERTY Macro: Describing QObject Properties |
347 |
15.5 |
QVariant Class: Accessing Properties |
350 |
15.6 |
DataObject: An Extension of QObject |
353 |
15.7 |
Property Containers: PropsMap |
355 |
Part I: Introduction to C++ and Qt 4
C++ Introduction
Classes
Introduction to Qt
Lists
Functions
Inheritance and Polymorphism
Part II: Higher-Level Programming
Libraries
Introduction to Design Patterns
QObject
Generics and Containers
Qt GUI Widgets
Concurrency
Validation and Regular Expressions
Parsing XML
Meta Objects, Properties, and Reflective Programming
More Design Patterns
Models and Views
Qt SQL Classes
Part III: C++ Language Reference
Types and Expressions
Scope and Storage Class
Statements and Control Structures
Memory Access
Chapter Summary
Inheritance in Detail
Miscellaneous Topics
Part IV: Programming Assignments
MP3 Jukebox Assignments
Part V: Appendices
MP3 Jukebox Assignments
Bibliography
MP3 Jukebox Assignments