Qt 在槽函数中获取信号发送对象 Qt中提供了一个函数 qobject_cast(QObject *object),可以通过这个函数判断信号发出对象 Qt 帮助文档的解释: Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns nullptr. If object is nullptr then it will also return nul
21 人赞同了该文章 本节内容主要讲解我对 Qt 属性系统的理解.官方文档参考 The Property System. 如何理解"属性系统"这个概念? 一般我们说一个类有什么属性,指的就是这个类有啥成员变量.比如 People 类中有个 int age 的私有成员变量,我们就可以说这个 People 类有个"年龄"属性可以更改读取. Qt 提供的这个属性系统,作用就是把类的信息暴露出来成为通用的大家都认识的信息.比如用 C++ 语言写的People 类中有个 in