But what is the exact problem? You can implement saveState() for your own widgets and use it to store their state in the byte array just as QMainWindow::saveState() does and then dump the blob to the same file as the original state. Then it's just a matter of reading byte arrays back and deciding which is related to which object (you can do that by using QObject::objectName()) and call restoreState().