Ok, it works so thanks to everybody but I am not sure I solve it the best way.
QSettings is set there at the very top of the application:
ApplicationWindow::ApplicationWindow()
{
ApplicationWindow::ApplicationWindow()
: QMainWindow( 0 )
{
QCoreApplication::setOrganizationName("Adrien");
QCoreApplication::setApplicationName("EFREI SMS");
QSettings settings("efrei.ini", QSettings::IniFormat);
To copy to clipboard, switch view to plain text mode
I had to put it public in this class AND pass it as parameter :
qS = iniGet( settings, "TxtCharSMSMax" ) + " " + qS2;
qS = iniGet( settings, "TxtCharSMSMax" ) + " " + qS2;
To copy to clipboard, switch view to plain text mode
to this procedure :
{
parameter = settings.value( s, "ERROR" ).toString();
if ( parameter == "ERROR" )
{
qS3 = "Unable to load parameter from efrei.ini";
qS4 = s + " not found. Replaced with 'Error'";
parameter = "Error";
}
return parameter;
}
QString ApplicationWindow::iniGet( QSettings &settings, const QString &s )
{
QString parameter;
QString qS3;
QString qS4;
parameter = settings.value( s, "ERROR" ).toString();
if ( parameter == "ERROR" )
{
qS3 = "Unable to load parameter from efrei.ini";
qS4 = s + " not found. Replaced with 'Error'";
QMessageBox::critical( this, qS3, qS4 );
parameter = "Error";
}
return parameter;
}
To copy to clipboard, switch view to plain text mode
When QSettings settings was declared private is this same class, for some reason it was not recognized in the iniGet.
Bookmarks