[Qt] Qt's Q_PROPERTY macro understanding of Qt

Table of contents

1. How to understand the concept of "attribute system"

2, Q_PROPERTY understanding

3. Example demonstration


1. How to understand the concept of "attribute system"

Generally, when we say what attributes a class has, we mean what member variables this class has. For example, if there is a private member variable of int age in the People class, we can say that this People class has an "age" attribute that can be changed and read.

The attribute system provided by Qt is used to expose class information and become common information that everyone knows. For example, there is an int ag in the People class written in C++ language

Guess you like

Origin blog.csdn.net/fanjufei123456/article/details/132799311