I'm completely new to python, i have question with setting width of PySide.QtGui.QDockWidget in python.

I have MainWindow class in python which inherits QtGui.QMainWindow ( PySide ) and have added
one left dock widget with simple plot and
one right dock widget with simple plot and
embedded simple plot in central widget.

I have to set width of each dock window.

Left Dock widget should take 20% width of my screen
Central Widget should take 40% width of my screen.
Right Dock Window should take 40% width of my screen.

I can't use setFixedWidth,minimum and maximum size because user should be able resize to any he wants.

I tried with QSizePolicy, i couldn't get solution.

Could anyone please provide good solution with examples ? Thanks.

You could use QDesktopWidget to get the 20% of the width of the screen. Use QDockWidget::resize to set the initial size.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.