0signal
23rd April 2011, 13:28
This is my code:
fileName = QFileDialog::getOpenFileName(this, tr("Open Image File"), QDir::currentPath());//QString
settings = new QSettings("Something", "Some Thing");//QSettings
settings->setValue("lastimage", fileName);
The value appears in the Windows registry as it should be, but when i try to convert it back to QString it returns an empty string (the value field in the registry key is empty).
Is there something wrong with this code:
fileName = settings->value("lastimage").toString();
or do I have to do something else ?
fileName = QFileDialog::getOpenFileName(this, tr("Open Image File"), QDir::currentPath());//QString
settings = new QSettings("Something", "Some Thing");//QSettings
settings->setValue("lastimage", fileName);
The value appears in the Windows registry as it should be, but when i try to convert it back to QString it returns an empty string (the value field in the registry key is empty).
Is there something wrong with this code:
fileName = settings->value("lastimage").toString();
or do I have to do something else ?