void ScoreAccessibility::updateAccessibilityInfo() { ScoreView* w = static_cast<MuseScore*>(mainWindow)->currentScoreView(); if (!w) return; currentInfoChanged(); //getInspector->isAncestorOf is used so that inspector and search dialog don't loose focus //when this method is called //TODO: create a class to manage focus and replace this massive if if ( (qApp->focusWidget() != w) && !mscore->inspector()->isAncestorOf(qApp->focusWidget()) && !(mscore->searchDialog() && mscore->searchDialog()->isAncestorOf(qApp->focusWidget())) && !(mscore->getSelectionWindow() && mscore->getSelectionWindow()->isAncestorOf(qApp->focusWidget())) && !(mscore->getPlayPanel() && mscore->getPlayPanel()->isAncestorOf(qApp->focusWidget())) && !(mscore->getSynthControl() && mscore->getSynthControl()->isAncestorOf(qApp->focusWidget())) && !(mscore->getMixer() && mscore->getMixer()->isAncestorOf(qApp->focusWidget())) && !(mscore->searchDialog() && mscore->searchDialog()->isAncestorOf(qApp->focusWidget())) && !(mscore->getDrumrollEditor() && mscore->getDrumrollEditor()->isAncestorOf(qApp->focusWidget())) && !(mscore->getPianorollEditor() && mscore->getPianorollEditor()->isAncestorOf(qApp->focusWidget()))) { mscore->activateWindow(); w->setFocus(); } QObject* obj = static_cast<QObject*>(w); QAccessibleValueChangeEvent ev(obj, w->score()->accessibleInfo()); QAccessible::updateAccessibility(&ev); }
void ScoreAccessibility::updateAccessibilityInfo() { currentInfoChanged(); ScoreView* w = static_cast<MuseScore*>(mainWindow)->currentScoreView(); //getInspector->isAncestorOf is used so that inspector doesn't lose focus //when this method is called if ( (qApp->focusWidget() != w) && !mscore->getInspector()->isAncestorOf(qApp->focusWidget())) { w->setFocus(); } QObject* obj = static_cast<QObject*>(w); QAccessibleValueChangeEvent ev(obj, w->score()->accessibleInfo()); QAccessible::updateAccessibility(&ev); }