Fix Tab and Ctrl-Tab keys handling and focus problems related to it.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16381 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-12-22 16:13:19 +00:00
parent 6c648c13a8
commit 9e4ac7fca9
2 changed files with 9 additions and 2 deletions

View File

@ -632,12 +632,11 @@ bool GuiView::event(QEvent * e)
if (e->type() == QEvent::ShortcutOverride) { if (e->type() == QEvent::ShortcutOverride) {
QKeyEvent * ke = static_cast<QKeyEvent*>(e); QKeyEvent * ke = static_cast<QKeyEvent*>(e);
if (ke->key() == Qt::Key_Tab) { if (ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) {
boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym); boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
sym->set(ke); sym->set(ke);
work_area_->processKeySym(sym, key_modifier::none); work_area_->processKeySym(sym, key_modifier::none);
e->accept(); e->accept();
centralWidget()->setFocus();
return true; return true;
} }
} }
@ -647,6 +646,13 @@ bool GuiView::event(QEvent * e)
} }
bool GuiView::focusNextPrevChild(bool /*next*/)
{
static_cast<GuiWorkArea *>(work_area_)->setFocus();
return true;
}
void GuiView::show() void GuiView::show()
{ {
QMainWindow::setWindowTitle(qt_("LyX")); QMainWindow::setWindowTitle(qt_("LyX"));

View File

@ -126,6 +126,7 @@ private:
/// in order to catch Tab key press. /// in order to catch Tab key press.
bool event(QEvent * e); bool event(QEvent * e);
bool focusNextPrevChild(bool);
QTimer statusbar_timer_; QTimer statusbar_timer_;