[qt] Fixed search text input focus issues

This commit is contained in:
Alex Zolotarev 2011-06-04 16:03:19 +02:00 committed by Alex Zolotarev
parent 42fa09b0a0
commit 62679898d2
2 changed files with 3 additions and 14 deletions

View file

@ -34,6 +34,9 @@ SearchPanel::SearchPanel(DrawWidget * drawWidget, QWidget * parent)
// for multithreading support
connect(this, SIGNAL(SearchResultSignal(search::Result *)),
this, SLOT(OnSearchResult(search::Result *)), Qt::QueuedConnection);
setFocusPolicy(Qt::StrongFocus);
setFocusProxy(m_pEditor);
}
template<class T> static void ClearVector(vector<T *> & v)
@ -95,14 +98,4 @@ void SearchPanel::OnSearchPanelItemClicked(int row, int)
}
}
void SearchPanel::showEvent(QShowEvent *)
{
m_pEditor->setFocus();
}
void SearchPanel::hideEvent(QHideEvent *)
{
m_pEditor->clearFocus();
}
}

View file

@ -31,10 +31,6 @@ signals:
private:
void SearchResultThreadFunc(search::Result const & result);
protected:
virtual void showEvent(QShowEvent *);
virtual void hideEvent(QHideEvent *);
public:
explicit SearchPanel(DrawWidget * drawWidget, QWidget * parent);
~SearchPanel();