We already thought about this mechanism, but that is not our main problem. Our main problem is, that its not predicable when QSettings wants to write, but after looking into the sources we found out, that is responds to a QEvent::UpdateRequest
Qt Code:
{ d->update(); return true; } } void QSettingsPrivate::update() { flush(); pendingChanges = false; } void QConfFileSettingsPrivate::flush() { sync(); }To copy to clipboard, switch view to plain text mode
sync is only called in the constructor/destructor and on request. So we think, that there is a good chance to get around this issue by using QObject#eventFilter and saving on our just before the destructor is called. (constructor is uncritical since it just reads the file)




Reply With Quote
Bookmarks