Important: Please read the Qt Code of Conduct -

Make a QDockWidget "unresizable"

  • Hello,
    I have a QMainWindows application with a QDockWidget on the top of my app. I use it as a Ribbon like in that GitHub :
    But I would like to make the QDockWidget "unresizable", I want to fixe its size. I tried that (at the end of the main Windows constructor), but my widget got a null size :


    How can I remove the possibily to change the size between that QDockWidgets and the others. Actually it's more the possibility to adaptate the position of each QDockWidget, and I want to disable it for my Ribbon.

    Thanks in advance,

  • Lifetime Qt Champion


    Do you mean you want to make it unmovable/floatable/etc ?

  • I changed my QDockWidget in QToolBar to solve my problem. Moreover, it avoids others QDockWidget to be moved in the same place :)

  • @SGaist I made it unmovable/floatable. but the possibility of change the size in relation to other QDockWdget was still allowed.

    But I found the solution, use a QToolBar to put my ribbon Inside. The size is fixed :)

Log in to reply