Q_PROPERTY设置属性时内联函数的使用

看到关于Q_PROPERTY属性设置的问题,所以再看看内联函数的知识:转载地址

Q_PROPERTY(int age_ READ age WRITE setAge)

// Property code start

private: int age_;

public: Q_SLOT inline int age() const

{ return age_; }

public: Q_SLOT inline void setAge(const int &newValue)

{ if ( newValue == age_ ) { return; } age_ = newValue; }

private:

// Property code end

发布了7 篇原创文章 · 获赞 0 · 访问量 154

猜你喜欢

转载自blog.csdn.net/qq_39027296/article/details/104918369