[qt4.1,win,g++] QSettings does not write settings
hi,
before an application is exited a method is called where the settings should
be written to the registry:
void
fdi_MainWindow::write_settings()
{
QSettings settings;
settings.setValue(fdinsight_settings + "/version", version );
settings.setValue(fdinsight_settings + "/window/posx", x() );
settings.setValue(fdinsight_settings + "/window/posy", y() );
settings.setValue(fdinsight_settings + "/window/width", width() );
settings.setValue(fdinsight_settings + "/window/height", height() );
}
i cannot find the settings in the registry, when the app tries to read
the settings they could not be read as well.
what's wrong?
regards,
jh
Re: [qt4.1,win,g++] QSettings does not write settings
What does QSettings::status() return? What is the value of fdinsight_settings variable?
Re: [qt4.1,win,g++] QSettings does not write settings
fdinsight_settings is just a qstring.
status returns:
QSettings::AccessError
how can it be that an access error occurs while trying to
write the registry? did i forget anything?
(btw. the code worked with qt3)
regards,
jh
Re: [qt4.1,win,g++] QSettings does not write settings
Add this behind the QApplication constructor of your main():
Code:
a.setOrganizationName("My Company");
a.setOrganizationDomain("mycompany.com");
a.setApplicationName("My Application");
Re: [qt4.1,win,g++] QSettings does not write settings
it works. thanx a lot!
jh