Chapter 15. Meta Objects, Properties, and Reflective Programming
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.
Anti-patterns | ||
QMetaObject: The MetaObject Pattern | ||
Type Identification and qobject_cast | ||
Q_PROPERTY Macro: Describing QObject Properties | ||
QVariant Class: Accessing Properties | ||
DataObject: An Extension of QObject | ||
Property Containers: PropsMap |
Anti-patterns
Anti-pattern[1] is a term first coined by [Gamma95] ...
Get An Introduction to Design Patterns in C++ with Qt 4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.