Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved QDockWidget half resizable

    General and Desktop
    qdockwidget resize separator
    2
    7
    2849
    Loading More Posts
    • 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.
    • S
      Siegwald last edited by Siegwald

      Hello,

      I have a desktop application with some dock widgets, allowed only in the top dock area.

      I want to have the height of the docks fixed, but the width resizable by the user.

      The problem is, if I set fixed height for dock widgets, and set preferred or expanding width, the separators and resizing handler disapppears for the both, and so the user can't resize horizontally.

      And it's the same result if I set preferred size policy for both width and height and I set minimum height and maximum height to the same value.

      There is a way to disable the vertical resize handler and and enable the horizontal resize handler ?

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi and welcome.
        Have you tried setting the maximum height on the widget you put in the dock?

        1 Reply Last reply Reply Quote 0
        • S
          Siegwald last edited by Siegwald

          Thanks.

          There is no one widget by dock. Some contains only one QLabel, and some a list of QPushButtons or QCheckBox and QRadioButtons.
          The content of each dock is managed by the appropriate layout.

          EDIT : My mistake, I can try this. A new dock widget (by QtDesigner) is automaticaly created with a containing widget (the one whitch have the layout).

          1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion last edited by

            ok. Im not sure it will work as Docks are funky but its worth a shot

            1 Reply Last reply Reply Quote 0
            • S
              Siegwald last edited by

              So I tried this : for the dock widget, the size policy is preferred and min-max sizes are default.
              And for the widget inside the dock (containing the layout and the other widgets), I let preferred also, but setted the maximum height and minimum height to the same desired value.

              Result : the same. There is no resizing handler even horizontaly.

              mrjj 1 Reply Last reply Reply Quote 0
              • mrjj
                mrjj Lifetime Qt Champion @Siegwald last edited by

                @Siegwald
                Hmm. yes. seems only to respect setMaximumHeight
                when floating (window)
                :(
                sorry

                1 Reply Last reply Reply Quote 0
                • S
                  Siegwald last edited by Siegwald

                  So, I cheated.

                  I set the max height to 180 pix and the min height to 179.
                  The vertical resize handler is still here, but a so little resize not affect the design of my window, and I can resize horizontaly as I want.

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post