Hey all!

I have a quick question: When using a splitter, I would like it to restore itself to the position it was at last time the application closed. I have been able to restore the main window's geometry just fine, but when attempting to restore a splitter, it doesn't work.

When the application starts:
Qt Code:
  1. QSettings settings;
  2.  
  3. // Main window settings
  4. settings.beginGroup("mainWindow");
  5. restoreGeometry(settings.value("geometry").toByteArray());
  6. splitter->restoreState(settings.value("splitterState").toByteArray());
  7. settings.endGroup();
To copy to clipboard, switch view to plain text mode 

When a close event is called:
Qt Code:
  1. QSettings settings;
  2.  
  3. // Main window settings
  4. settings.beginGroup("mainWindow");
  5. settings.setValue("geometry", saveGeometry());
  6. settings.setValue("splitterState", splitter->saveState());
  7. settings.endGroup();
To copy to clipboard, switch view to plain text mode 

The splitter always starts in the middle, regardless of where I leave it at close.

Any help?