The below code works just fine under Windows XP but fails to resize and move window under Windows 7 64bit.
I can not understand why. This is a dual monitor system. HELP!
void MainWindow::GetWindowSettings()
{
QSettings settings("C:/temp/temp.ini", QSettings::IniFormat);
settings.beginGroup("MainWindow");
resize(settings.value("size", QSize(800, 600)).toSize());
move(settings.value("pos", QPoint(5, 30)).toPoint());
settings.endGroup();
}
void MainWindow::SaveWindowSettings()
{
QSettings settings("C:/temp/temp.ini", QSettings::IniFormat);
settings.beginGroup("MainWindow");
settings.setValue("size", size());
settings.setValue("pos", pos());
settings.endGroup();
settings.sync();
}
The settings are saved and read back in as I have tested that. However, the move and resize do not happed!!
Bookmarks