Important: Please read the Qt Code of Conduct -

I need help working with saveGeometry() and saveState() on Pyside

  • Hello, I'm writing an application with a main window composed by 4 QDockWidgets. I would like that the 4 QDockWidgets would be visible when the the program starts up, but what I'm getting is that the QDockWidgets start-up very close to the MainWindow edges and so most of its content isn't visible.
    I tried to solve this problem with the Resize() function, the setGeometry() function, but had no success, the QDockWidgets remained unchaged.
    Also tried a solution that I think is more interesting. I made a button that when pressed it makes a call to MainWindow_object.saveGeometry() and MainWindow_object.saveState(), that save the window state and configuration to a file on the Disk. And in the MainWindow is placed code that when the program starts the file with the window configuration is read, and loaded into the MainWindow through restoreGeometry() and restoreState().
    But when I run the program, the QDockWidgets always start on the same positions, and with most of the content cut.

    You can see and try the code here, it is in Python:

    I really appreciate your help, because this is my current work and is important to me. Thanks for reading, Best Regards. DavidQ

Log in to reply