QString msgText = QString("The file has been saved at %1\sysconf.xml").arg(QApplication::applicationDirPath);
Run Code Online (Sandbox Code Playgroud)
给我上面的错误.我.arg()之前使用过,所以我想知道它为什么会给我这个错误?.arg()我的代码中的所有其他代码都正常工作.
说明
QApplication::applicationDirPath是一个静态成员函数,要获得您正在寻找的值,您必须将其视为这样,因此; 你必须调用该函数.
目前您正在尝试将函数指针传递给QString::arg,并且由于编译器无法为此类构造找到合适的重载,因此会引发诊断.
解决方案
QString msgText = QString(...).arg(QApplication::applicationDirPath ());
Run Code Online (Sandbox Code Playgroud)
注:请参阅添加()后QApplication::applicationDirPath.
| 归档时间: |
|
| 查看次数: |
857 次 |
| 最近记录: |