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

Method set_action

src/laybasic/laybasic/layAbstractMenu.cc:264–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264void
265AbstractMenuItem::set_action (Action *a, bool copy_properties)
266{
267 tl_assert (a != 0);
268
269 a->keep ();
270
271#if defined(HAVE_QT)
272 if (copy_properties && mp_action->qaction () && a->qaction ()) {
273 a->qaction ()->setIcon (mp_action->qaction ()->icon ());
274 a->qaction ()->setToolTip (mp_action->qaction ()->toolTip ());
275 a->qaction ()->setShortcut (mp_action->qaction ()->shortcut ());
276 a->qaction ()->setIconText (mp_action->qaction ()->iconText ());
277 }
278#endif
279
280 bool enabled = mp_action.get () ? mp_action->is_enabled () : true;
281 bool visible = mp_action.get () ? mp_action->is_visible () : true;
282 mp_action->set_dispatcher (0);
283 mp_action.reset (a);
284 mp_action->set_enabled (enabled);
285 mp_action->set_visible (visible);
286 mp_action->set_dispatcher (mp_dispatcher);
287 mp_action->set_object_name (m_basename);
288
289#if defined(HAVE_QT)
290 if (mp_action->menu ()) {
291 mp_action->menu ()->setObjectName (tl::to_qstring (m_basename));
292 }
293#endif
294}
295
296void
297AbstractMenuItem::set_action_title (const std::string &s)

Callers 1

buildMethod · 0.80

Calls 13

to_qstringFunction · 0.85
qactionMethod · 0.80
set_object_nameMethod · 0.80
menuMethod · 0.80
keepMethod · 0.45
iconMethod · 0.45
getMethod · 0.45
is_enabledMethod · 0.45
is_visibleMethod · 0.45
set_dispatcherMethod · 0.45
resetMethod · 0.45
set_enabledMethod · 0.45

Tested by

no test coverage detected