[vlc-commits] Qt: fix enter event in addons manager

Valter Correia git at videolan.org
Wed Oct 28 22:21:12 CET 2015


vlc/vlc-2.2 | branch: master | Valter Correia <valtergcorreia at ua.pt> | Tue Oct 27 22:45:55 2015 +0000| [18875c3c160e69b47ebf0a36288c8ef5d9b6090d] | committer: Jean-Baptiste Kempf

Qt: fix enter event in addons manager

Hitting ENTER in addon manager search field no longer makes tab content disappear

Closes #15162, #14553

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 167830d4c39b773ad28f591d2e4ecb66d43022b8)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=18875c3c160e69b47ebf0a36288c8ef5d9b6090d
---

 modules/gui/qt4/dialogs/plugins.cpp |   10 ++++++++++
 modules/gui/qt4/dialogs/plugins.hpp |    3 +++
 2 files changed, 13 insertions(+)

diff --git a/modules/gui/qt4/dialogs/plugins.cpp b/modules/gui/qt4/dialogs/plugins.cpp
index ea26029..9008ec5 100644
--- a/modules/gui/qt4/dialogs/plugins.cpp
+++ b/modules/gui/qt4/dialogs/plugins.cpp
@@ -489,6 +489,16 @@ AddonsTab::~AddonsTab()
     delete spinnerAnimation;
 }
 
+// Do not close on ESC or ENTER
+void AddonsTab::keyPressEvent( QKeyEvent *keyEvent )
+{
+    if( keyEvent->key() == Qt::Key_Return ||
+        keyEvent->key() == Qt::Key_Enter )
+        keyEvent->accept();
+    else
+        keyEvent->ignore();
+}
+
 bool AddonsTab::eventFilter( QObject *obj, QEvent *event )
 {
     if ( obj != addonsView->viewport() )
diff --git a/modules/gui/qt4/dialogs/plugins.hpp b/modules/gui/qt4/dialogs/plugins.hpp
index d49c70c..91bc94e 100644
--- a/modules/gui/qt4/dialogs/plugins.hpp
+++ b/modules/gui/qt4/dialogs/plugins.hpp
@@ -130,6 +130,9 @@ class AddonsTab : public QVLCFrame
     Q_OBJECT
     friend class PluginDialog;
 
+protected:
+    void keyPressEvent( QKeyEvent *keyEvent ) Q_DECL_OVERRIDE;
+
 private slots:
     void moreInformation();
     void installChecked( int );



More information about the vlc-commits mailing list