Home > Mobile >  Questions about using QFile open files
Questions about using QFile open files

Time:02-21

 
QString curPath=QDir: : currentPath ();//acquisition system in the current directory
QString dlgTitle="open a file";//dialog title
QString filter="program files (*. H *. CPP);; Text files (*.txt);; All files (*. *) ";//file filters
QString aFileName=QFileDialog: : getOpenFileName (this, dlgTitle curPath, filter);

QString STR=QDir: : currentPath ();
//STR=QDir: : toNativeSeparators (STR);
QString str1=QString (" % 1/name. TXT "). Arg (STR);
QFile mdir (STR);//=STR;
QFile mdir2 (aFileName);
QDebug () & lt;

From the value of STR and aFileName content without any distinction, why qDebug output is a false one is true?
  •  Tags:  
  • Qt
  • Related