【发布时间】:2017-11-13 09:45:17
【问题描述】:
http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html
class Message : public QObject
{
Q_OBJECT
Q_PROPERTY(QString author READ author WRITE setAuthor NOTIFY authorChanged)
public:
void setAuthor(const QString &a) {
if (a != m_author) {
m_author = a;
emit authorChanged();
}
}
QString author() const {
return m_author;
}
signals:
void authorChanged();
private:
QString m_author;
};
他们写了emit authorChanged();。
我想知道这个信号的插槽在哪里?
当authorChanged() 信号发出时,哪些代码会发生变化?
【问题讨论】: