c++ - About Qt MessageBox::warning() overloading -


qmessagebox::warning(this,tr("error"),                              tr("file existed")); 

i use qtcreator msvs2012,win7. "this" points class public inherited qwizard class, compiler output is

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 4 overloads convert argument types. can give me help?

replace this 0 , should work.

basically, dialog box doesn't need parent. can stand alone , not have problem.

https://qt-project.org/doc/qt-4.8/objecttrees.html

and comments question said, can't call warning in const method either.

another option rid of const'ness of newwizard() method.

hope helps.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -