Block focus out event

The line edit wasn't being properly updated regarding its
paint event. Turns out it was because it received a focus
out event and then stopped refreshing the paint.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-09-22 15:23:38 -03:00 committed by Dirk Hohndel
parent eb2c78e953
commit 33a19328d8
2 changed files with 9 additions and 1 deletions

View file

@ -396,7 +396,6 @@ int DiveLocationModel::rowCount(const QModelIndex& parent) const
return dive_site_table.nr + 2;
}
bool DiveLocationModel::setData(const QModelIndex& index, const QVariant& value, int role)
{
if(!index.isValid())
@ -465,6 +464,14 @@ bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e)
return false;
}
void DiveLocationLineEdit::focusOutEvent(QFocusEvent* ev)
{
if (!view->isVisible()) {
qDebug() << "Focusing Out";
QLineEdit::focusOutEvent(ev);
}
}
void DiveLocationLineEdit::itemActivated(const QModelIndex& index)
{
qDebug() << "Activated" << index.data();

View file

@ -103,6 +103,7 @@ public:
protected:
void keyPressEvent(QKeyEvent *ev);
void focusOutEvent(QFocusEvent *ev);
void showPopup();
private:
DiveLocationFilterProxyModel *proxy;