Skip to Content
Introduction to Design Patterns in C++ with Qt, 2nd Edition
book

Introduction to Design Patterns in C++ with Qt, 2nd Edition

by Alan Ezust, Paul Ezust
September 2011
Intermediate to advanced
768 pages
15h 18m
English
Pearson
Content preview from Introduction to Design Patterns in C++ with Qt, 2nd Edition

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

An Introduction to Design Patterns in C++ with Qt 4

An Introduction to Design Patterns in C++ with Qt 4

Alan Ezust, Paul Ezust
Programming with Qt, 2nd Edition

Programming with Qt, 2nd Edition

Matthias Kalle Dalheimer

Publisher Resources

ISBN: 9780132851619Purchase book