Qt
編譯時報錯:
error: ‘emit’ was not declared in this scope; did you mean ‘exit’?
9 | emit Button->clicked();
| ^~~~
| exit
這是因爲在pro工程文件中添加了:
CONFIG += no_keywords
解決該報錯,可以使用Q_EMIT
替換 emit
類似的,使用Q_SLOTS
來替換slot
。
Qt
編譯時報錯:
error: ‘emit’ was not declared in this scope; did you mean ‘exit’?
9 | emit Button->clicked();
| ^~~~
| exit
這是因爲在pro工程文件中添加了:
CONFIG += no_keywords
解決該報錯,可以使用Q_EMIT
替換 emit
類似的,使用Q_SLOTS
來替換slot
。