当前位置:网站首页>Pyqt5 technical part - cause of the problem that setting the top of the window does not take effect. Setwindowflags() does not take effect after setting the parameters. Solution

Pyqt5 technical part - cause of the problem that setting the top of the window does not take effect. Setwindowflags() does not take effect after setting the parameters. Solution

2022-06-11 20:40:00 Xiaolan jujube


Possible situation : Be overwritten

       
Dialog.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Set window top
Dialog.setWindowFlags(QtCore.Qt.WindowCloseButtonHint) # Set the close button only
  • 1.
  • 2.

If there are more than one ​setWindowFlags()​, Only the last one works , Because it is an overlay setting .

terms of settlement ​: Merging parameters .

       
Dialog.setWindowFlags(QtCore.Qt.WindowCloseButtonHint|QtCore.Qt.WindowStaysOnTopHint)
  • 1.

A vertical bar is used between multiple parameters ​​'|'​​ Separate .

Let's like it !



原网站

版权声明
本文为[Xiaolan jujube]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203011732269218.html