O'Reilly logo

An Introduction to Design Patterns in C++ with Qt 4 by Paul Ezust, Alan Ezust

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

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

Anti-patterns

Anti-pattern[1] is a term first coined by [Gamma95] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required