Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Initial "DockWidget->toggleViewAction()" value
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 203 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    avmg
    wrote on last edited by avmg
    #1

    Hi all,

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

    DockWidget->toggleViewAction()->toggle();
    

    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,
    avmg

    1 Reply Last reply
    0
    • A Offline
      A Offline
      avmg
      wrote on last edited by
      #2

      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:

      triggerAction->trigger();
      

      Thanks anyway!

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved