Use QWidget::raise() and QApplication::setActiveWindow().