0

I'm trying to set the initial size from QDockwidget docks. I tried with QSplitter but so far I couldn't achieve it...

Any suggestions, post, or help?

Thanks in advance!

AV9
  • 31
  • 4

1 Answers1

0

Well, it can get head-popping :-(. The QMainWindoq has a method resizeDocks, which you can use this way (PyQt5):

    docks = [self.dwSource, self.dwDBitems, self.dwProps]
    docksizes = [250,250,250]
    self.resizeDocks(docks, docksizes, Qt.Horizontal)

The sizes will be adjusted such that the maximum and the minimum sizes are respected and the QMainWindow itself will not be resized

You can start from there, but it's not guaranteed it will be applied, in my experience. Often, you have to set sizePolicy and sizeHint to the particular widgets contained in the docks.

Oak_3260548
  • 1,882
  • 3
  • 23
  • 41