View Full Version : Qt's similar function as GetPrivateProfileString and WritePrivateProfileString
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.
QSettings uses registry by default on Windows but it can also read and write .ini files.
Thank you jpn!;)
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.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.