[Kde-bindings] KDE::ConfigGroup unable to read and read a font config entry in korundum
Stefano Crocco
stefano.crocco at alice.it
Sat May 2 07:48:45 UTC 2009
On Friday 01 May 2009, Stefano Crocco wrote:
> |I just found this issue: I have a config file, created with KDE::Config,
> | which contains a font entry. When I try to read it back, however, it
> | fails saying "KConfigGroup::convertToQVariant: unhandled type". Reading a
> | QFont, however, should be supported, as the documentation for
> | KConfigGroup says and a quick test using C++ confirms.
> |Am I missing something?
I found a way to read and write the entries. It was simple and I don't know
why the idea didn't occur to me sooner, despite the two hours I spent thinking
about it. To write the entry, I only needed to pass write_entry a Qt::Variant
created from the value using Qt::Variant.from_value. To read it back, I needed
to convert the default value to a Qt::Variant in the same way and pass it as
second argument to read_entry. This way read_entry returns a Qt::Variant from
which I get the value using Qt::Variant#value.
I'd still like to know if there's no way to do this without the intermediate
Qt::Variant.
Stefano
More information about the Kde-bindings
mailing list