sorting problem in QSetting set.allkeys() ??
i want to read some db names from a config file and they are ordered.
but when i read them with allkeys , the data that i have now is sorted by allkeys!
what can i do ?
Code:
//for example
settings.setValue("a", Qt::white);
settings.
setValue("c",
QSize(32,
96));
settings.setValue("b", true);
settings.setValue("d", false);
//instead of a c b d i have a b c d !!
but i need a c b d ???
any idea.
thanks
Re: sorting problem in QSetting set.allkeys() ??
I'm afraid you can't AND you shouldn't rely on the order settings are saved. As you know, the storage behind QSettings might be an INI file, XML preferences file or Windows registry. I'd suggest adjusting your design not to care about the order...
Re: sorting problem in QSetting set.allkeys() ??
Quote:
Originally Posted by
jpn
I'm afraid you can't AND you shouldn't rely on the order settings are saved. As you know, the storage behind QSettings might be an INI file, XML preferences file or Windows registry. I'd suggest adjusting your design not to care about the order...
:( I THINK SO .
may be i can have a another value and give them a number for they order. :o
Re: sorting problem in QSetting set.allkeys() ??
;)
i use this way ! so orders can take place by %Number :rolleyes:
%01
%00
%02
when i write to config :setting.setValue("/Database/"+dbName.prepend(row)); %01Name
when i read from config :dbnames.at(row).remove(0,1) Give Me Name