replace if/else with switch

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13974 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Edwin Leuven 2006-05-31 14:46:01 +00:00
parent 2d73110e2c
commit 98a75b6456

View File

@ -103,24 +103,30 @@ void InsertTableWidget::mouseMoveEvent(QMouseEvent * event)
bool InsertTableWidget::event(QEvent * event)
{
if (event->type() == QEvent::MouseMove) {
switch (event->type()) {
case QEvent::MouseMove: {
QMouseEvent * me = dynamic_cast<QMouseEvent *>(event);
mouseMoveEvent(me);
return true;
} else if (event->type() == QEvent::MouseButtonRelease) {
}
case QEvent::MouseButtonRelease: {
QMouseEvent * me = dynamic_cast<QMouseEvent *>(event);
mouseReleaseEvent(me);
return true;
} else if (event->type() == QEvent::MouseButtonPress) {
}
case QEvent::MouseButtonPress: {
// swallow this one...
return true;
} else if (event->type() == QEvent::Leave) {
}
case QEvent::Leave: {
bottom_ = 0;
right_ = 0;
update();
return true;
}
default:
return QWidget::event(event);
}
return QWidget::event(event);
}