How to make QWidget get input method focus on Mac

157 Views Asked by At

I am using QWidget to create a mirrored window of my mobile phones on MacOS.

I'm using setAttribute(Qt::WA_InputMethodEnabled, true); so that my Qwidget can get the text input from Sogou input method on Mac.

There is only one QOpenGLWidget in my QWidget to display mobile phone mirroring. When I click on some position of Qwidget and type , the display position of the Sogou input method is always under Qwidget, far away from where I clicked, because there is no input focus on QOpenGLWidget.

How can I do that?

0

There are 0 best solutions below