Dar*_*enW 1 c++ gcc compiler-errors qt4
我们很困惑为什么gcc在我们的应用程序中抱怨这一行:
doubleFrom->setValidator(new QDoubleValidator(doubleFrom));
Run Code Online (Sandbox Code Playgroud)
抱怨这些:
error: expected type-specifier before 'QDoubleValidator'
error: expected `)' before 'QDoubleValidator'
error: no matching function for call to 'QLineEdit::setValidator(int*)'
candidates are: void QLineEdit::setValidator(const QValidator*)
Run Code Online (Sandbox Code Playgroud)
(我已经删除了文件,行号的冗长路径.)
是的,setValidator希望得到一个const QValidator*,这就是我们在这一行源代码中所做的事情.为什么gcc想要过早地看到')',并认为我们正在为setValidator提供一个int*?
当然,"昨天编好了,我们没有改变任何东西.真的!"
| 归档时间: |
|
| 查看次数: |
222 次 |
| 最近记录: |