升级到 Qt 5.15 时收到以下错误消息:
QML Connections: Implicitly defined onFoo properties in Connections are deprecated.
Use this syntax instead: function onFoo(<arguments>) { ... }
下面贴上对应的QML代码
Connections {
target: AppProxy
onLogsReady: function(logs) {
textLogs.text = logs
}
}
其中onLogsReady
是在类中定义的信号AppProxy
:
class AppProxy : public QObject {
Q_OBJECT
Q_DISABLE_COPY(AppProxy)
public:
AppProxy(QObject* parent = 0);
~AppProxy();
signals:
void logsReady(QString logs);
// ...
};
我想知道如何抑制这个警告。