Hi,
I have a problem that I can't find the ini file and it seems that even the default settings are not set.
The declaration:
QSettings *p_projsettings;
To copy to clipboard, switch view to plain text mode
After it I expect the File created
p_projsettings = new QSettings("c:temp\MySoft\DCP_MON_INI.ini", QSettings::IniFormat);
To copy to clipboard, switch view to plain text mode
defaultvalues();
p_projsettings->sync();
if(p_projsettings
->status
()==QSettings::NoError) {
retval=false;
}
else
{
retval=true;
}
qDebug() << "Status ProjSettings:" << retval;
return (retval);
defaultvalues();
p_projsettings->sync();
if(p_projsettings->status()==QSettings::NoError)
{
retval=false;
}
else
{
retval=true;
}
qDebug() << "Status ProjSettings:" << retval;
return (retval);
To copy to clipboard, switch view to plain text mode
The status is alway false
void INI_FILE::defaultvalues()
{
p_projsettings->value("BAUD","230400");
p_projsettings->value("PORT","COM3");
p_projsettings->value("PARITY","NONE");
p_projsettings->value("DATABIT","8");
p_projsettings->value("STOPBIT","1");
p_projsettings->value("FLOWCONTROL","FLOW_OFF");
p_projsettings->value("TIMEOUT","150");
// qDebug("projsettings BAUD",projsettings->value("BAUD"));
qDebug() << "projsettings BAUD:" << p_projsettings->value("BAUD").toString();
p_projsettings->sync();
}
void INI_FILE::defaultvalues()
{
p_projsettings->value("BAUD","230400");
p_projsettings->value("PORT","COM3");
p_projsettings->value("PARITY","NONE");
p_projsettings->value("DATABIT","8");
p_projsettings->value("STOPBIT","1");
p_projsettings->value("FLOWCONTROL","FLOW_OFF");
p_projsettings->value("TIMEOUT","150");
// qDebug("projsettings BAUD",projsettings->value("BAUD"));
qDebug() << "projsettings BAUD:" << p_projsettings->value("BAUD").toString();
p_projsettings->sync();
}
To copy to clipboard, switch view to plain text mode
Could anybody please tell me what is wrong?
Thanks!
Bookmarks