1. 程式人生 > >PyQt5 將視窗暫時置於所有視窗最前方(喚醒視窗、視窗置頂)

PyQt5 將視窗暫時置於所有視窗最前方(喚醒視窗、視窗置頂)

void QWidget::raise()

Raises this widget to the top of the parent widget's stack.

After this call the widget will be visually in front of any overlapping sibling widgets.

Note: When using activateWindow(), you can call this function to ensure that the window is stacked on top.

Widget類中又raise()方法可以實現這個功能。

(由於在python3中 raise 是一個關鍵字,所以在PyQt5中這個方法的名字為 raise_,即widget.raise_()