[Solved]What is the data type of list<string> on c++ site?
-
Want to do some postprocessing on the FileUrls of the FileDialog
@
FileDialog{
id: fileDialogselectMultiple: true nameFilters: [ "Image files (*.bmp *.jpg *.JPEG *.png *.ppm *.tiff *.xbm *.xpm)" ] onAccepted: { fileProcess.print_strs(fileDialog.fileUrls) } }
@
The signature of cpp site
@
void fileProcess::print_strs(QList<QString> const &strs)
{
qDebug()<<"print strs";
for(auto const &str: strs){
qDebug()<<"print strs : "<<str;
}
}
@QList do not map to the type of list in qml
which type should I use? -
Thanks, looks like QUrl is the correct answer
-
Whatever, the document of the FileDialog and FileDialog itself are mismatch.
document
@
filePath : string
filePaths : list<string>
@But in Qt5.1RC, I have to use fileUrl or fileUrls to access the address of the files.Maybe this is because this is RC but not a formal release