QSettings
constuctor needs at least 2 strings organization
name and application
name
QSettings::QSettings(const QString & organization, const QString & application = QString(), QObject * parent = 0);
In your case just use this code below in your main()
(1)If you use QSettings
from many places in your application, you might want to specify the organization name and the application name using QCoreApplication::setOrganizationName()
and QCoreApplication::setApplicationName()
, and then use the default QSettings
constructor:
QCoreApplication::setOrganizationName("MySoft");
QCoreApplication::setOrganizationDomain("mysoft.com");
QCoreApplication::setApplicationName("Star Runner");
...
QSettings settings; //default constructor
(1)reference: QSettings