sno*_*kin 9 c++ qt properties qt4
我无法弄清楚为什么需要它,请阅读:http: //doc.qt.io/qt-4.8/properties.html#requirements-for-declaring-properties
仍然无法真正理解它的使用.任何形式的帮助都会很棒!
ism*_*ail 12
阅读Qt属性系统,这就像通常的类方法,但它可以与Qt的元对象系统一起使用:
QPushButton *button = new QPushButton;
QObject *object = button;
button->setDown(true);
object->setProperty("down", true);
Run Code Online (Sandbox Code Playgroud)
此外,这些属性也将在Qt Designer下可见,因此您可以创建具有某些属性的自定义窗口小部件并在Qt Designer中将其挂钩,有关详细信息,请参阅此文章.