QSetting and writing REG_BINARY to registry
Hi ,
i want to add value to windows registry binary value. I am using QSettings.setValue()
method. I want to add 0x20000000 value as a REG_BINARY type . I am using like this.
QSettings lReg("HKEY_CURRENT_USER\\Software\\...\\x");
QByteArray lArr=QByteArray::fromHex("0x20000000");
QVariant lVar=QVariant::fromValue(lArr);
lReg.setValue("test",lVar");
but after executing code like this. "test" value type is equal REG_BINARY but value is "@QByteArray(20..)". QSettings writes to registry my value and name QByteArray.
How can i avoid this? I only want to write my value .
Thanks in advance
Ramazan
Re: QSetting and writing REG_BINARY to registry
lReg.setValue("test",lVar");
is the extra quote causing prob ?
Re: QSetting and writing REG_BINARY to registry
It is my fault. It is correct in code. The problem isn't this. I can compile and run code like this . My problem is writing correct BINARY value to windows registry.
Re: QSetting and writing REG_BINARY to registry
try to use QSettings::NativeFormat in ctor of QSetting object.
Re: QSetting and writing REG_BINARY to registry
I have tried
QSettings lReg("HKEY_CURRENT_USER\\Software\\...\\x",QSettin g::NativeFormat);
...
This doesn't correct my problem.
Re: QSetting and writing REG_BINARY to registry
It seems, it's a bug in Qt. Please see task #100648 on TackTracker:
http://trolltech.com/developer/task-...ntry&id=100648
This bug was scheduled for 4.2.0, but it doesn't work for me too on Qt 4.4.3. I think, you should write a bug report about yuor issue
Re: QSetting and writing REG_BINARY to registry
This is oficial answer form Trolltech:
Quote:
QSettings does not fully support reading and writing of the registry
type REG_BINARY. There is a suggestion in task tracker regarding this
issue. This task has ID:108395.