fix the last fix for the tab stuff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6722 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2003-04-05 21:59:40 +00:00
parent 988355b92f
commit 98da3d5b1d
3 changed files with 13 additions and 8 deletions

View File

@ -28,6 +28,7 @@
#include "LString.h"
using std::vector;
using std::endl;
namespace {

View File

@ -41,12 +41,16 @@ void QCommandEdit::keyPressEvent(QKeyEvent * e)
}
void QCommandEdit::focusOutEvent(QFocusEvent * e)
bool QCommandEdit::event(QEvent * e)
{
if (e->reason() == QFocusEvent::Tab) {
emit tabPressed();
return;
}
if (e->type() != QEvent::KeyPress)
return QLineEdit::event(e);
QLineEdit::focusOutEvent(e);
QKeyEvent * ev = (QKeyEvent *)e;
if (ev->key() != Key_Tab)
return QLineEdit::event(e);
emit tabPressed();
return true;
}

View File

@ -32,9 +32,9 @@ signals:
void tabPressed();
protected:
virtual void keyPressEvent(QKeyEvent * e);
virtual bool event(QEvent * e);
virtual void focusOutEvent(QFocusEvent * e);
virtual void keyPressEvent(QKeyEvent * e);
};
#endif // QCOMMANDEDIT_H