Important: Please read the Qt Code of Conduct -

[Solved] Initial "DockWidget->toggleViewAction()" value

  • Hi all,

    How can I set the initial visibility from a DockWidget??? I know I can toggle the view with:


    But I want it hidden on the start-up, and also be able to switch it via some function, not only with buttons.

    Thanks in advance,

  • Hi again,

    I could finally make it! I created a new action and I have connected it with the "toggleViewAction" from the DockWidget:

    triggerAction = new QAction(this);
    connect(triggerAction, &QAction::triggered, DockWidget->toggleViewAction(), &QAction::triggered);

    Then later I can trigger the new action:


    Thanks anyway!

Log in to reply