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

Method event

src/laybasic/laybasic/layAbstractMenu.cc:341–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339 }
340
341 bool event(QEvent *e)
342 {
343 if (e->type() == QEvent::Shortcut) {
344
345 QShortcutEvent *se = static_cast<QShortcutEvent *>(e);
346 if (se->isAmbiguous() && sp_actionHandles) {
347
348 QString msg = QObject::tr ("Keyboard shortcut is ambiguous: ");
349 msg += QString (se->key ().toString ());
350 msg += tl::to_qstring ("\n\n");
351 msg += QObject::tr ("Targets of the that shortcut are:");
352 msg += tl::to_qstring ("\n");
353
354 for (std::set<Action *>::const_iterator a = sp_actionHandles->begin (); a != sp_actionHandles->end (); ++a) {
355 if (! (*a)->qaction ()->shortcut ().isEmpty () && (*a)->qaction ()->shortcut ().matches (se->key ()) != QKeySequence::NoMatch) {
356 msg += QChar (0x2022) /*bullet*/;
357 msg += tl::to_qstring (" ");
358 msg += (*a)->qaction ()->text ();
359 msg += tl::to_qstring ("\n");
360 }
361 }
362
363 QMessageBox::warning (0, QObject::tr ("Warning"), msg);
364
365 return true;
366
367 }
368
369 }
370
371 return QAction::event(e);
372 }
373
374private:
375 size_t m_id;

Callers 1

eventFilterMethod · 0.45

Calls 14

to_qstringFunction · 0.85
warningFunction · 0.85
qactionMethod · 0.80
eventFunction · 0.70
trFunction · 0.50
QCharClass · 0.50
typeMethod · 0.45
toStringMethod · 0.45
keyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected