-void ChatViewSearchBar::setVisible(bool visible) {
- QWidget::setVisible(visible);
- ui.searchEditLine->clear();
- if(visible) ui.searchEditLine->setFocus();
+
+void ChatViewSearchBar::setVisible(bool visible)
+{
+ // clearing the search field also removes the highlight items from the scene
+ // this should be done before the SearchBar is hidden, as the hiding triggers
+ // a resize event which can lead to strange side effects.
+ ui.searchEditLine->clear();
+ QWidget::setVisible(visible);
+ if (visible)
+ ui.searchEditLine->setFocus();
+ else
+ emit hidden();