[PyQt] How to precisely control position/size of QDockWidgets
R Johnson (Gmail)
ps16thypresenceisfullnessofjoy at gmail.com
Tue Apr 22 23:18:52 BST 2014
Thank you for your helpful reply.
QMainWindow.setCorner() does do what I wanted. I should have read the
documentation more carefully about that, but couldn't find anything
relevant on the QDockWidget page.
Regarding specifying "the default width or height of the dock windows,"
I have attached another screenshot showing what I mean. The red
rectangle shows the current width of the dock window, and the green one
shows what I want the width to be. The default width wastes a lot of
space in my layout. I have tried calling:
on the QTreeWidget that the dock window contains, but this has no effect.
I also tried:
but that didn't work either.
If I make 150 pixels the maximum width of the dock window, then it is
the width I want it, but it can't be made any wider. I don't want to
make 150 pixels the maximum (or minimum) width of the pane, just the
default width. It also seems like the policy that I would want for
QSizePolicy.setHorizontalPolicy() is QSizePolicy.Preferred, which is
already the default one.
I'm still confused about this. How can I tell Qt the default width (or
"best size", in wxPython terms) of this dock window?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PyQt dock window.png
Size: 26290 bytes
Desc: not available
More information about the PyQt