QMessageBox::warning(this,tr("Error"),
tr("File existed"));
I use QtCreator for MSVS2012,Win7. "this" points to a class that public inherited from QWizard class, the compiler output isAbout Qt MessageBox::warning() overloading
error C2665: 「QMessageBox::warning」: 4 個重載中沒有一個可以轉換所有參數類型 d:\qt\qt5.1.0\5.1.0\msvc2012_64\include\qtwidgets\qmessagebox.h(197): 可能是「QMessageBox::StandardButton QMessageBox::warning(QWidget *,const QString & ,const QString & ,QMessageBox::StandardButtons,QMessageBox::StandardButton)」 嘗試匹配參數列表「(const newWizard *const , QString, QString)」時
it means none of the 4 overloads could convert all the argument types. Anyone can give me some help?
Just to get this clear, is the '個重載中沒有一個可以轉換所有參數類型' a custom error message you created yourself in the source? Or (showing my total ignorance about Qt here) are you using a localised version of Qt? –
@MrLister: he's using a localized version of Windows it seems. –
It looks like 'this' is a pointer to a const QWidget, while it requires a non-const object. – JRG