2016-11-19 318 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])