Why QMainWindow and not QDialog parented to the window that called the vkb? You could disable text entry in a QTextEdit and listen to clicked().