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. QDockWidget visibility problem
Forum Updated to NodeBB v4.3 + New Features

QDockWidget visibility problem

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 365 Views 1 Watching
  • 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.
  • H Offline
    H Offline
    HB76
    wrote on last edited by
    #1

    Hi everyone !

    I am develloping an app that use a dock widget and I would like to sync the dock visibility with an action in my menubar. What I want is to be able to show/hide my dock when clicking in the action in the menubar, or to do it manually by clicking on the close button of the dock and update the dock status in the menubar.

    The problem is that when I detach my dock and then I re-dock it, my app crash. Also, if I minimise my window, the dock desapear and I need to make it visible again manually. I know the problem come to the signal visibilityChanged but there is no closed signal for dock widget to check if the close button have been pushed..
    Here is my code :

    actionShowDock = dock->toggleViewAction();
    connect(actionShowDock, SIGNAL(toggled(bool)), dock, SLOT(setVisible(bool)));
    connect(dock, SIGNAL(visibilityChanged(bool)), actionShowDock, SLOT(setChecked(bool)));
    

    Do you have any idea of how I should do to avoid these problems ?
    Thanks !

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Remove these two connections, they are not needed as the action already handles the visibility.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3

      • Login

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