Can anyone be so kind enough to tell me Qt's similar function as MFC's GetPrivateProfileString and WritePrivateProfileString?
Thank you very much!
Can anyone be so kind enough to tell me Qt's similar function as MFC's GetPrivateProfileString and WritePrivateProfileString?
Thank you very much!
QSettings uses registry by default on Windows but it can also read and write .ini files.
J-P Nurmi
hiuao (3rd May 2007)
I use QSettings as the document said:
const QSettings::Format XmlFormat =
QSettings::registerFormat("xml", readXmlFile, writeXmlFile);
QSettings settings(XmlFormat, QSettings::UserScope, "MySoft",
"Star Runner");
the error is no matching function for call to `QSettings::registerFormat(const char[4], <unknown type>, <unknown type>)
and I have to define
bool readXmlFile(QIODevice &device, QSettings::SettingsMap &map);
bool writeXmlFile(QIODevice &device, const QSettings::SettingsMap &map);
in the head file,because define in the .cpp file there will be errors,and ask for their definitions.
How to deal with such a question?Thank you very much!
Yes, you will have to declare functions before passing function pointers to them.
J-P Nurmi
Bookmarks