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 half resizable
QtWS25 Last Chance

QDockWidget half resizable

Scheduled Pinned Locked Moved Solved General and Desktop
qdockwidgetresizeseparator
7 Posts 2 Posters 3.4k 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.
  • S Offline
    S Offline
    Siegwald
    wrote on last edited by Siegwald
    #1

    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
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Siegwald
        wrote on last edited by Siegwald
        #3

        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
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Siegwald
            wrote on last edited by
            #5

            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.

            mrjjM 1 Reply Last reply
            0
            • S Siegwald

              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.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Siegwald
                wrote on last edited by Siegwald
                #7

                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
                1

                • Login

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