Re: [Interest] Write QSettings to a QString in INI format

2019-10-26 Thread Henry Skoglund
On 2019-10-26 17:31, Murphy, Sean wrote: Because QSettings has the file locked. Make sure settings goes out of scope before you re-open the file. Granted, it's complex with the locking code, but underneath it all you have this hidden gem writeIniFile(), which takes a QIODevice and the map (you

Re: [Interest] Write QSettings to a QString in INI format

2019-10-26 Thread Thiago Macieira
On Saturday, 26 October 2019 02:43:48 PDT Konrad Rosenbaum wrote: > > So I if all the above is correct, and there is no way to write an INI > > formatted string to memory, and given the fact that I really don't want a > > file in the first place, I decided to look at writing the settings out to > >

Re: [Interest] Write QSettings to a QString in INI format

2019-10-26 Thread Murphy, Sean
> > Because QSettings has the file locked. Make sure settings goes out of > > scope before you re-open the file. > > > Granted, it's complex with the locking code, but underneath it all you have > this hidden gem writeIniFile(), which takes a QIODevice and the map (you > know, the function with tho

Re: [Interest] Write QSettings to a QString in INI format

2019-10-26 Thread Murphy, Sean
> This is basically the way to go. Thanks, although again I'd prefer to not have to do the actual file roundtrip, but it's not horrible. > > > > void MainWindow::writeSettings() > > { > > // comment/uncomment the *define* below to switch implementations > > #define USE_QTEMPORARY_FILE > > > > #i

Re: [Interest] Write QSettings to a QString in INI format

2019-10-26 Thread d3fault
On 10/24/19, Murphy, Sean wrote: > I'd like to be able to have QSettings write out my settings to an INI file > format, but I'd like to avoid writing it to an actual file, instead just > writing it to "something" in memory (for example, a QString, QByteArray, > QBuffer, etc.). > If "something in

Re: [Interest] Write QSettings to a QString in INI format

2019-10-26 Thread Henry Skoglund
On 2019-10-26 11:43, Konrad Rosenbaum wrote: Hi, On 10/24/19 5:53 PM, Murphy, Sean wrote: I'd like to be able to have QSettings write out my settings to an INI file format, but I'd like to avoid writing it to an actual file, instead just writing it to "something" in memory (for example, a QSt

Re: [Interest] Write QSettings to a QString in INI format

2019-10-26 Thread Konrad Rosenbaum
Hi, On 10/24/19 5:53 PM, Murphy, Sean wrote: I'd like to be able to have QSettings write out my settings to an INI file format, but I'd like to avoid writing it to an actual file, instead just writing it to "something" in memory (for example, a QString, QByteArray, QBuffer, etc.). That's beca

Re: [Interest] Write QSettings to a QString in INI format

2019-10-25 Thread Murphy, Sean
> > So I guess I can use QFile to create my own file, do what I need to > > do, then remove it myself when I'm done, but is there any alternative > > way to get what I want - QSetting written to a QString? > > There are overloads of QFile::open() that take a system file handle / file > descriptor.

Re: [Interest] Write QSettings to a QString in INI format

2019-10-25 Thread Kai Köhne
> -Original Message- > From: Interest On Behalf Of Murphy, Sean > Sent: Thursday, October 24, 2019 5:53 PM > To: interest@qt-project.org > Subject: [Interest] Write QSettings to a QString in INI format > > I'd like to be able to have QSettings write out

[Interest] Write QSettings to a QString in INI format

2019-10-24 Thread Murphy, Sean
I'd like to be able to have QSettings write out my settings to an INI file format, but I'd like to avoid writing it to an actual file, instead just writing it to "something" in memory (for example, a QString, QByteArray, QBuffer, etc.). As far as I can tell, there doesn't seem to be any way to