Problem with QSettings
-
Is that your full code about QSettings?
Then according to the doc:QSettings::QSettings(QObject *parent = nullptr)
Constructs a QSettings object for accessing settings of the application and organization set previously with a call to QCoreApplication::setOrganizationName(), QCoreApplication::setOrganizationDomain(), and QCoreApplication::setApplicationName().
The scope is QSettings::UserScope and the format is defaultFormat() (QSettings::NativeFormat by default). Use setDefaultFormat() before calling this constructor to change the default format used by this constructor.
The codeQSettings settings("Moose Soft", "Facturo-Pro");
is equivalent to
QCoreApplication::setOrganizationName("Moose Soft");
QCoreApplication::setApplicationName("Facturo-Pro");
QSettings settings;If QCoreApplication::setOrganizationName() and QCoreApplication::setApplicationName() has not been previously called, the QSettings object will not be able to read or write any settings, and status() will return AccessError.
You could try using a filename when creating QSettings:
QSettings settings("settings.ini", QSettings::IniFormat); -
@amy-cpp said in Problem with QSettings:
the problem is gone :)
so please don't forget to mark your post as solved!