fixed key events in goToFlow

TODO: add eventFilter to goToFlow edit...
This commit is contained in:
Luis Ángel San Martín
2013-12-10 23:37:29 +01:00
parent 883ac04917
commit 75e3d12f2e
10 changed files with 70 additions and 54 deletions

View File

@ -26,6 +26,8 @@ GoToFlowWidget::GoToFlowWidget(QWidget * parent)
mainLayout->setSpacing(0);
setLayout(mainLayout);
//toolBar->installEventFilter(this);
}
GoToFlowWidget::~GoToFlowWidget() {
@ -53,12 +55,21 @@ void GoToFlowWidget::keyPressEvent(QKeyEvent* event)
case Qt::Key_S:
QCoreApplication::sendEvent(this->parent(),event);
break;
case Qt::Key_Left: case Qt::Key_Right:
//if(event->modifiers() == Qt::ControlModifier)
//flow->keyPressEvent(event);
//QCoreApplication::sendEvent(flow,event);
break;
}
event->accept();
}
/*bool GoToFlowWidget::eventFilter(QObject * target, QEvent * event)
{
if(event->type() == QEvent::KeyPress)
{
QKeyEvent * e = static_cast<QKeyEvent *>(event);
if(e->key()==Qt::Key_S || e->key() == Qt::Key_Space)
{
this->keyPressEvent(e);
return true;
}
}
return QWidget::eventFilter(target,event);
}*/