Fixed bug. Now the color is changing for tabbing and backtabbing.

modified:   mscore/accessibletoolbutton.cpp
This commit is contained in:
Andrei Tuicu 2014-06-04 22:36:37 +03:00
parent 95a08bbab0
commit 032ab3c0be

View file

@ -8,15 +8,15 @@ namespace Ms {
AccessibleToolButton::AccessibleToolButton(QWidget* parent, QAction* defaultQAction ): QToolButton(parent){
this->setDefaultAction(defaultQAction);
this->setFocusPolicy(Qt::StrongFocus);
this->setAutoRaise(true);
this->setAccessibleName(defaultQAction->text());
this->setAccessibleDescription(defaultQAction->toolTip());
}
void AccessibleToolButton::focusInEvent(QFocusEvent* e){
//If the button gains focus by tabbing, it will change its color
if(e->reason() == Qt::TabFocusReason){
//If the button gains focus by tabbing or backtabbing, it will change its color
if(e->reason() == Qt::TabFocusReason || e->reason() == Qt::BacktabFocusReason){
setGraphicsEffect(new QGraphicsColorizeEffect());
}