[vlc-commits] Qt: fix enter event in addons manager
Valter Correia
git at videolan.org
Wed Oct 28 22:20:18 CET 2015
vlc | branch: master | Valter Correia <valtergcorreia at ua.pt> | Tue Oct 27 22:45:55 2015 +0000| [167830d4c39b773ad28f591d2e4ecb66d43022b8] | 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>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=167830d4c39b773ad28f591d2e4ecb66d43022b8
---
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 9b3523e..1da97e3 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