3626 |
3626 |
3627 @param menu reference to the menu to be populated (QMenu) |
3627 @param menu reference to the menu to be populated (QMenu) |
3628 """ |
3628 """ |
3629 menu.clear() |
3629 menu.clear() |
3630 |
3630 |
3631 tbList = [] |
3631 for name, (text, tb) in sorted(self.__toolbars.items(), |
3632 for name, (text, tb) in list(self.__toolbars.items()): |
3632 key=lambda t: t[1][0]): |
3633 tbList.append((text, tb, name)) |
|
3634 |
|
3635 for text, tb, name in sorted(tbList, key=lambda t: t[0]): |
|
3636 act = menu.addAction(text) |
3633 act = menu.addAction(text) |
3637 act.setCheckable(True) |
3634 act.setCheckable(True) |
3638 act.setChecked(not tb.isHidden()) |
3635 act.setChecked(not tb.isHidden()) |
3639 act.setData(name) |
3636 act.setData(name) |
3640 menu.addSeparator() |
3637 menu.addSeparator() |