MCPcopy Create free account
hub / github.com/KLayout/klayout / insert_action_after

Function insert_action_after

src/laybasic/laybasic/layAbstractMenu.cc:1230–1248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1228}
1229
1230static QAction *insert_action_after (QWidget *widget, QAction *after, QAction *action)
1231{
1232 QList<QAction *> actions = widget->actions ();
1233
1234 QAction *before = 0;
1235 if (after == 0) {
1236 if (! actions.isEmpty ()) {
1237 before = actions.front ();
1238 }
1239 } else {
1240 int index = actions.indexOf (after);
1241 if (index >= 0 && index + 1 < actions.size ()) {
1242 before = actions [index + 1];
1243 }
1244 }
1245 widget->insertAction (before, action);
1246
1247 return action;
1248}
1249
1250static const std::string s_extras_menu_name ("_extras_menu");
1251

Callers 1

buildMethod · 0.85

Calls 5

actionsMethod · 0.80
isEmptyMethod · 0.45
frontMethod · 0.45
indexOfMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected