MarkoSan
12th June 2008, 23:59
Hi to all!
I've subclassed QSettings class and in implementation I have following code:
void CApplicationSettings::saveSettings()
{
for (qint16 iIndex=0; iIndex<m_SettingsValues.size(); iIndex++)
{
beginGroup(m_SettingsValues.at(iIndex).strHub);
setValue(m_SettingsValues.at(iIndex).strKey,
m_SettingsValues.at(iIndex).varValue);
endGroup();
} // for
// for (qint16 iIndex=0; iIndex<m_SettingsValues.size(); iIndex++)
// {
// if(m_SettingsValues.at(iIndex).strHub==databaseSet tingKey)
// {
// beginGroup(databaseSettingKey);
// qDebug() << "m_SettingsValues.at(iIndex).strKey: " << m_SettingsValues.at(iIndex).strKey
// << " " << "m_SettingsValues.at(iIndex).varValue: " << m_SettingsValues.at(iIndex).varValue;
// setValue(m_SettingsValues.at(iIndex).strKey, m_SettingsValues.at(iIndex).varValue.toString());
// endGroup();
// } // if
// } // for
// for (qint16 iIndex=0; iIndex<m_SettingsValues.size(); iIndex++)
// {
// if(m_SettingsValues.at(iIndex).strHub==languageSet tingsKey)
// {
// beginGroup(languageSettingsKey);
// qDebug() << "m_SettingsValues.at(iIndex).strKey: " << m_SettingsValues.at(iIndex).strKey
// << " " << "m_SettingsValues.at(iIndex).varValue: " << m_SettingsValues.at(iIndex).varValue;
// setValue(m_SettingsValues.at(iIndex).strKey, m_SettingsValues.at(iIndex).varValue.toString());
// endGroup();
// } // if
// } // forResult of this class, INI file, after this code looks like that:
[dbSettings]
dbHost=0
dbName=0
dbPassword=0
dbType=0
dbUserName=0
[langSettings]
langID=0
langTranslatorFile=0All values are zeroed, but they must not be. Why?!
I've subclassed QSettings class and in implementation I have following code:
void CApplicationSettings::saveSettings()
{
for (qint16 iIndex=0; iIndex<m_SettingsValues.size(); iIndex++)
{
beginGroup(m_SettingsValues.at(iIndex).strHub);
setValue(m_SettingsValues.at(iIndex).strKey,
m_SettingsValues.at(iIndex).varValue);
endGroup();
} // for
// for (qint16 iIndex=0; iIndex<m_SettingsValues.size(); iIndex++)
// {
// if(m_SettingsValues.at(iIndex).strHub==databaseSet tingKey)
// {
// beginGroup(databaseSettingKey);
// qDebug() << "m_SettingsValues.at(iIndex).strKey: " << m_SettingsValues.at(iIndex).strKey
// << " " << "m_SettingsValues.at(iIndex).varValue: " << m_SettingsValues.at(iIndex).varValue;
// setValue(m_SettingsValues.at(iIndex).strKey, m_SettingsValues.at(iIndex).varValue.toString());
// endGroup();
// } // if
// } // for
// for (qint16 iIndex=0; iIndex<m_SettingsValues.size(); iIndex++)
// {
// if(m_SettingsValues.at(iIndex).strHub==languageSet tingsKey)
// {
// beginGroup(languageSettingsKey);
// qDebug() << "m_SettingsValues.at(iIndex).strKey: " << m_SettingsValues.at(iIndex).strKey
// << " " << "m_SettingsValues.at(iIndex).varValue: " << m_SettingsValues.at(iIndex).varValue;
// setValue(m_SettingsValues.at(iIndex).strKey, m_SettingsValues.at(iIndex).varValue.toString());
// endGroup();
// } // if
// } // forResult of this class, INI file, after this code looks like that:
[dbSettings]
dbHost=0
dbName=0
dbPassword=0
dbType=0
dbUserName=0
[langSettings]
langID=0
langTranslatorFile=0All values are zeroed, but they must not be. Why?!