Qt World Summit: Register Today!

How I hide/show whole parts of the QMainWindow?

  • My QMainWindow has basically 2 states.

    In one state, it displays ONLY a file browser, and other related stuff (recent files list, and so on).

    After you choose a file, I want it to show ONLY dock widgets, and disable the central widget.

    I think the logic should be:

    File browser: hide all dock areas (but NOT the widgets, the user might want their hidden/visible status stay as they were before), set the central widget to the file browser.

    File open: hide the central widget, show all dock areas.

    So how I do that?

  • Lifetime Qt Champion

    Docks need a central widget.
    They can be docked around it.

    You can however alter the size of it etc.

    So what exactly are you hoping would happen if you could disable it ?

  • Well, without a central widget, everything can be docked and undocked from everywhere.

    I found a program that was made with QT, and do what I want partially.


    Everything on that screenshot is dragable, the functions window, graph, tabs, exports, imports, all of those are dockable, and also become tabs (also, I noticed some stuff docked inside another dock? ie: the exports and imports).

  • Lifetime Qt Champion

    Ok that is cool.
    What is the name of this app ?
    Normally, its not so happy to dock in center.

Log in to reply