12.9.  Review Questions

[ fromfile: reflection-questions.xml id: reflection-questions ]

  1. What kinds of information can you obtain from a QMetaObject?

  2. What Qt classes are used to do data reflection? Explain why.

  3. How does the QMetaObject code for each of your QObject-derived classes get generated?

  4. What is a downcast? In what situations do you use them?

  5. What is RTTI? How does Qt provide RTTI?

  6. Discuss the differences between the dynamic_cast and qobject_cast operators.

  7. What is a QVariant? How might you make use of one?

  8. What are the advantages of using property() and setProperty() over direct getters and setters?

  9. What does the property() function return? How do you obtain the actual stored value?

  10. Explain how it is possible to add new properties, acquired at runtime, to a QObject.

  11. Explain how dynamic properties can be serialized.