Abdelrazak Younes wrote:
Stefan Schimanski wrote:
The bug: http://bugzilla.lyx.org/show_bug.cgi?id=3588
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.
I have tested it only on OSX. Would be good if somebody confirms that
it works on Windows and Linux.
Stefan
Index: src/frontends/qt4/QCommandBuffer.cpp
===================================================================
--- src/frontends/qt4/QCommandBuffer.cpp (Revision 18815)
+++ src/frontends/qt4/QCommandBuffer.cpp (Arbeitskopie)
@@ -66,8 +66,11 @@
Considering this:
if (ev->key() == Qt::Key_Escape) {
hide();
return;
- }
- QListWidget::keyPressEvent(ev);
This line looks suspicious:
Sorry, I misread Key_Space for Key_Escape. But Key_Space of course
doesn't look right as an LFUN can have arguments.
+ } else if (ev->key() == Qt::Key_Return || ev->key() ==
Qt::Key_Space) {
@@ -185,6 +188,7 @@
QWidget const * widget = static_cast<QWidget const *>(sender());
const_cast<QWidget *>(widget)->hide();
edit_->setText(item->text() + ' ');
+ edit_->activateWindow();
This is fine I guess.
edit_->setFocus();
}