1. Get its corresponding underlying window handle (that is, nativeHandle) through a window object of type QWidget. You can use the qwidget:: winid () method to get the handle, for example: QWidget*widget=newQWidget.
2、WIdwinId = widget-& gt; WinId (). Create a QWindow object through the bottom window handle and set it as the top window. You can use the QWindow:: fromwindow () method to create a QWindow object, for example: qwindow * window = qwindow:: fromwindow (winid).
3, the window->; Set flags (Qt:: window | Qt:: FramesWindowHint | Qt:: WindowStaysOnTopHint). In the above code, we set the QWindow object as the highest-level window, and added some window properties (such as FramesWindowHint and Windowstaysontophint) to set it according to our needs.