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. Minimum Height in QDockWidget widget
Forum Updated to NodeBB v4.3 + New Features

Minimum Height in QDockWidget widget

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.3k 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.
  • J Offline
    J Offline
    jpalbertini
    wrote on last edited by
    #1

    Hy everybody (and sorry for my bad english...),

    I got a mystical behaviour with a QDockWidget (DW) added to my QMainWindow (MW):

    I got the DW docked , and when I try to hide it by getting the slider down to the bottom, it is blocked to minimum width.
    To fix it, it try to set the minimal width of the DW widget to '0'. it changes nothing. But when I set it to '1', it works fine.

    Is this a normal behaviour ?

    Thanks for your answers :)

    1 Reply Last reply
    0
    • B Offline
      B Offline
      b1gsnak3
      wrote on last edited by
      #2

      Logically (at least to my logic) this is a normal behaviour, because setting the width to 0 should be impossible because a widget with 0 width is basically a widget that exists in background (similar to hidden) and might cause problems for a user (it will remain active), therefore using up resources that are not needed. I say this assuming that your DW is derived from a standard QWidget. One thing you can try is hide DW. If this doesn't resize your MW, then try setting the MinimumWidth for your MW->dockedWidget() to 1.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jpalbertini
        wrote on last edited by
        #3

        Thanks for you reply,

        I can hide the DW with the cross, but I want to do it by resizing it...
        Ideally, I wanted to set the width of the child of the DW by 0 so only the header of the DW would appear...

        I tried to set the minimal width of the DW to '1' but it doesn't work, and apparently it should not according to the doc:

        bq. A QDockWidget acts as a wrapper for its child widget, set with setWidget(). Custom size hints, minimum and maximum sizes and size policies should be implemented in the child widget. QDockWidget will respect them, adjusting its own constraints to include the frame and title. Size constraints should not be set on the QDockWidget itself, because they change depending on whether it is docked; a docked QDockWidget has no frame and a smaller title bar.

        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