Try setting the focus on the text edit (QWidget::setFocus()). You might also consider using focus proxies.