Hello. I have a text editor. When closing the program, I save the name and path to the file in the registry, so that when I open it I open it. Opening:
QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName()); settings.setValue("hyperText/fileName", fileName); settings.setValue("hyperText/fileUrl", fileUrl); settings.sync(); Reading:
QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName()); return settings.value("hyperText/fileUrl" + "hyperText/fileName"); But how to save and open the path and file name if there are several of them (without knowing their number first)?
QStringListwith a list of files, it is supported inQSettingsout of the box without the need of crutches - Bearded Beaver