PDA

View Full Version : Migrate Qt3 QSettings to Qt4 QSettings



hvengel
21st February 2008, 00:57
Working on a Qt3 to Qt4 port we are noticing that QSettings loses the users setting from Qt3. In addition the file format is changed and the Qt4 QSettings system ignores the Qt3 configuration settings even if the Qt3 ini file is moved to the new Qt4 location and renamed to have the default Qt4 file name.

This has to be an issue for other projects and I would like to know how others are handling it. I have done searches here and on the net and have not found anything about this.

hvengel
21st February 2008, 03:08
I found this on the net:


Message 3 in thread

* Subject: Re: QSettings path for Ini files.
* From: Jasmin Blanchette <jasmin@xxxxxxxxxxxxx>
* Date: Wed, 05 Jan 2005 14:55:33 +0100
* Cc: qt4-preview-feedback@xxxxxxxxxxxxx
* Organization: Trolltech
* To: porten@xxxxxxxxxxxxx

Harri Porten wrote:

> I think it would be highly preferable if the same directory and files were
> used as users upgrading their application would otherwise lose all their
> settings. After an initial learning experience we decided not to annoy
> users with redoing their customization after an upgrade.

This is hardly possible. The way Qt 3 used INI is very different to what
Qt 4 does. For example, Qt 3 represented QStringLists as
"item1\eitem2\e...\eitemN", where \e is the escape character. This is
neither the standard INI way of doing things nor a recommendable format
for Qt 4.

In other words, applications that want to reuse the Qt 3 settings should
load the settings using Q3Settings and save them again using QSettings.

...

Jasmin

This seems like it would help me solve this issue and since it was written by a Troll it appears to be credible. But searching the net for other reference to Q3Settings only finds stuff about a well known game. Anyone know where to find info about this? I can't seem to find anything related to this in my Qt4 installation or anywhere else for that matter. Anyone know anythings about this?

jpn
21st February 2008, 08:13
This seems like it would help me solve this issue and since it was written by a Troll it appears to be credible. But searching the net for other reference to Q3Settings only finds stuff about a well known game. Anyone know where to find info about this? I can't seem to find anything related to this in my Qt4 installation or anywhere else for that matter. Anyone know anythings about this?
He must've been mistaken because no such class is part of the Qt3Support module.

hvengel
22nd February 2008, 03:21
OK so how are we supposed to migrate our users Qt3 setting when they upgrade to the Qt4 version of our software? I find it hard to believe that I am the only one who has run into this issue. Particularly considering that the issue has apparently been known about by the Trolls since the Qt4 preview time frame (over 3 years).