how to get the list of files without their extensions in a specified directory in Qt

StackOverflow https://stackoverflow.com/questions/15787193

  •  31-03-2022
  •  | 
  •  

Pergunta

i want to get all the files that are located in a specified directory but without their extensions at the end .I did this Qt Code:

QDir myDir(mConfigDirectory);

         filters << "*.ini";
         myDir.setNameFilters(filters);
     list = myDir.entryList ();
    qDebug()<<list;

but i can't find the way to separate the name from the extension and get only names?!

Foi útil?

Solução

QFileInfo Class doesn't help in this case? See QString QFileInfo::baseName

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top