franco.amato
9th April 2010, 03:20
Hi,
I would load some settings from an ini file.
Some settings are QColors so in my ini file I have a color section with many points so:
[colors]
background=
waveform=
timeline=
markers=
selection=
I would set some default values living empty the color fields in the ini file so I would that Qt load the default values so:
QColor defColor = Qt::white; //default value
QVariant colVariant = defColor; //convert in QVariant
m_bgColor = settings.value( "background", colVariant ).value<QColor>(); // I would Qt::white as default value
but debuggind it says that m_bgColor is invalid and doesn't has the desired value.
Where I'm wrong?
Best
I would load some settings from an ini file.
Some settings are QColors so in my ini file I have a color section with many points so:
[colors]
background=
waveform=
timeline=
markers=
selection=
I would set some default values living empty the color fields in the ini file so I would that Qt load the default values so:
QColor defColor = Qt::white; //default value
QVariant colVariant = defColor; //convert in QVariant
m_bgColor = settings.value( "background", colVariant ).value<QColor>(); // I would Qt::white as default value
but debuggind it says that m_bgColor is invalid and doesn't has the desired value.
Where I'm wrong?
Best