var _list = mywindow.list();
function sExpand()
{
_list.expandAll();
}
function sCollapse()
{
_list.collapseAll();
}
var _expand = toolbox.createWidget("QPushButton", mywindow, "_expand");
var _collapse = toolbox.createWidget("QPushButton", mywindow, "_collapse");
_expand.text = qsTr("E&xpand All");
_collapse.text = qsTr("C&ollapse All");
var _layout = toolbox.widgetGetLayout(_list);
_layout.addWidget(_expand, 3, 0);
_layout.addWidget(_collapse, 4, 0);
_expand.clicked.connect(sExpand);
_collapse.clicked.connect(sCollapse);