From: Stefan Schimanski Date: Thu, 21 Jun 2007 06:38:50 +0000 (+0000) Subject: * On MacOSX enter is no activation key for a QListWidget. Hence it X-Git-Tag: 1.6.10~9326 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5286634d170045792fd5b32f5d8888e4ffc7494b;p=features.git * On MacOSX enter is no activation key for a QListWidget. Hence it does not close the command completion popup. Moreover setFocus does not focus the widget correctly, probably because the popup widget behavior is different. An activateWindow solves the problem by selecting the LyX view again as active window. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18840 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/QCommandBuffer.cpp b/src/frontends/qt4/QCommandBuffer.cpp index b418c990de..faba90d947 100644 --- a/src/frontends/qt4/QCommandBuffer.cpp +++ b/src/frontends/qt4/QCommandBuffer.cpp @@ -66,8 +66,11 @@ protected: if (ev->key() == Qt::Key_Escape) { hide(); return; - } - QListWidget::keyPressEvent(ev); + } else if (ev->key() == Qt::Key_Return || ev->key() == Qt::Key_Space) { + // emit signal + itemPressed(currentItem()); + } else + QListWidget::keyPressEvent(ev); } }; @@ -185,6 +188,7 @@ void QCommandBuffer::complete_selected(QListWidgetItem * item) QWidget const * widget = static_cast(sender()); const_cast(widget)->hide(); edit_->setText(item->text() + ' '); + edit_->activateWindow(); edit_->setFocus(); }