QString总出错,请教Qstring
QString *mypath;
mypath=new QString();
mypath=QFileDialog::getOpenFileName(this,tr("open"),".",tr("Image File(*.jpg *.png)"));
报错cannot convert 'QString' to 'QString*' in assignment
改为
QString mypath;
mypath=QFileDialog::getOpenFileName(this,tr("open"),".",tr("Image File(*.jpg *.png)"));
就正常
想问 new QString这行用不行吗?为什么