2016-11-19 272 views

回答

0

一些小部件,如SplitPanel,有一个setSizes()方法。

在问题联的示例中,面板CodeMirror能像这样被调整大小(其它板将需要更多的通过层次挖掘):

// First, find the parent widget: 

stackedLayout = panel.layout     
dockSplitPanel = stackedLayout._children[0] 

// OR directly: panel.layout._children[0] 


// Then set the relative sizes so the CodeMirror panel takes 60% of the width: 
dockSplitPanel.setSizes([6,4])