bool event(QEvent * e) override { if (e->type() == QEvent::Shortcut) { auto se = static_cast<QShortcutEvent *>(e); auto focusWidget = QApplication::focusWidget(); if (se->isAmbiguous() && focusWidget != nullptr) { for (const auto& action : QtMenu::sharedQActions_) { auto qAction = action.second.lock(); if(!qAction) { continue; } bool keyMatches = qAction->shortcut() == se->key(); bool isContextual = qAction->shortcutContext() == Qt::WidgetShortcut; auto associatedWidgets = qAction->associatedWidgets(); if (!keyMatches || !isContextual) { continue; } for(auto& widget : associatedWidgets) { if(widget == focusWidget && qAction->isEnabled() && qAction->isVisible()) { qAction->trigger(); return true; } } } } } return QAction::event(e); }
int KmerAffect::getStrand() const{ if (isUnknown() || isAmbiguous()) return 0; return affect_strand(affect); }
bool KmerAffect::isGeneric() const { return !(isUnknown() || isAmbiguous()); }
// Returns true if c is a valid symbol in this alphabet bool IUPAC::isValid(char c) { return isUnambiguous(c) || isAmbiguous(c); }