程序输出:
QPropertyAnimation: you're trying to animate the non-writable property width of your QObject
头文件:
Q_PROPERTY(int width READ width WRITE setMaximumWidth)
源文件:
QPropertyAnimation *animation = new QPropertyAnimation(mywidget, "width");
这句代码mywidget换成this以后可以正常运行,两者都是QWidget,mywidget在该类里面生成,请问可能是什么地方出现了bug呢?