134 |
134 |
135 newActions = [] |
135 newActions = [] |
136 newActionsWithSeparators = [] |
136 newActionsWithSeparators = [] |
137 actions = toolBar.actions() |
137 actions = toolBar.actions() |
138 for action in actions: |
138 for action in actions: |
|
139 actID = id(action) |
139 self.addAction(action, category) |
140 self.addAction(action, category) |
140 if id(action) in self.__widgetActions: |
141 if actID in self.__widgetActions: |
141 self.__widgetActions[id(action)] = toolBar |
142 self.__widgetActions[actID] = toolBar |
142 newActionsWithSeparators.append(action) |
143 newActionsWithSeparators.append(action) |
143 if action.isSeparator(): |
144 if action.isSeparator(): |
144 action = None |
145 action = None |
145 else: |
146 else: |
146 self.__actionToToolBars[id(action)].append(toolBar) |
147 if toolBar not in self.__actionToToolBars[actID]: |
|
148 self.__actionToToolBars[actID].append(toolBar) |
147 newActions.append(action) |
149 newActions.append(action) |
148 tbID = id(toolBar) |
150 tbID = id(toolBar) |
149 self.__defaultToolBars[tbID] = newActions |
151 self.__defaultToolBars[tbID] = newActions |
150 self.__toolBars[tbID] = newActions |
152 self.__toolBars[tbID] = newActions |
151 self.__toolBarsWithSeparators[tbID] = newActionsWithSeparators |
153 self.__toolBarsWithSeparators[tbID] = newActionsWithSeparators |
381 """ |
383 """ |
382 if action is None: |
384 if action is None: |
383 return |
385 return |
384 if action.isSeparator(): |
386 if action.isSeparator(): |
385 return |
387 return |
386 if action in self.__allActions: |
388 if id(action) in self.__allActions: |
387 return |
389 return |
388 |
390 |
389 if action.metaObject().className() == "QWidgetAction": |
391 if action.metaObject().className() == "QWidgetAction": |
390 self.__widgetActions[id(action)] = None |
392 self.__widgetActions[id(action)] = None |
391 self.__allWidgetActions[id(action)] = action |
393 self.__allWidgetActions[id(action)] = action |