Skip to content

Commit

Permalink
Merge pull request #1 from murph/master
Browse files Browse the repository at this point in the history
Fix issue with spacebar in search box of library
  • Loading branch information
klnusbaum committed Feb 23, 2013
2 parents 6c7879a + fb03661 commit 63d8e63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/LibraryWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,26 @@
#include <QGridLayout>
#include <QLineEdit>
#include <QLabel>
#include <QKeyEvent>

namespace UDJ{

bool LibraryWidget::eventFilter(QObject *obj, QEvent *event) {
if (obj->inherits("QLineEdit") && event->type() == QEvent::KeyRelease)
return true;
else
return false;
}

LibraryWidget::LibraryWidget(DataStore* dataStore, QWidget* parent):
QWidget(parent),
dataStore(dataStore)
{
libraryView = new LibraryView(dataStore, this);
searchEdit = new QLineEdit(this);

searchEdit->installEventFilter(this);

QLabel *searchLabel = new QLabel(tr("Search:"),this);

setFocusPolicy(Qt::TabFocus);
Expand Down
2 changes: 2 additions & 0 deletions src/LibraryWidget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Q_OBJECT

//@}

protected:
bool eventFilter(QObject *obj, QEvent *event);
};


Expand Down

0 comments on commit 63d8e63

Please sign in to comment.