PDA

View Full Version : QSettings inserts "phantom" data



smoon
13th March 2011, 13:11
Hi,

I have the problem that QSettings creates data which doesn't exist. I save my settings with the following function:


void MainWindow::writeSettings() {
settings->setValue("LastDB", db->getDbName());
settings->setValue("Window/Size", size());
settings->setValue("Window/Maximize", isMaximized());
}

But the QMap, which is delivert to the write function contains the following data:


QMap(
( "LastDB", QVariant(QString, "F:/Develop/YAMDB/movie.yamdb") )
( "LastDB/Window/Maximize" , QVariant(QString, "false") )
( "Window/Maximize" , QVariant(bool, false) )
( "Window/Size" , QVariant(QSize, QSize(900, 650) ) )
)

Where does the value "LastDB/Window/Maximize" came from :confused:

mcosta
14th March 2011, 07:45
Are you sure there are no OLD wrong values in you Settings?
Print settings content before writeSettings().