O'Reilly logo

An Introduction to Design Patterns in C++ with Qt™, Second Edition 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 12: Meta Objects, Properties, and Reflective Programming

This chapter introduces the idea of reflection, the self-examination of an object’s members. Using reflective programming, you can write general-purpose operations that work on classes of varied structures. Using QVariant, a generic value-holder, you can operate on built-in types and other common types in a uniform way.

12.1 QMetaObject—The MetaObject Pattern

A meta object is an object that describes the structure of another object.1

The MetaObject Pattern

QMetaObject is Qt’s implementation of the MetaObject pattern. It provides information about the properties and methods of a QObject. The MetaObject pattern is sometimes known as the Reflection pattern.

A class that has a MetaObject ...

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