全屏显示PyQtWebEngine是Flash屏幕

问题描述

在全屏模式下,PyQtWebEngineView是启动屏幕。这严重影响了用户体验。我尝试搜索解决此问题。

但是只能搜索C / C ++ Qt5以获得代码

QWindowsWindowFunctions::setHasBorderInFullScreen(windowHandle(),true)

虽然可以,但不能在python中使用。

如何在PyQt5中解决此问题?

解决方法

试试这个解决方案!

https://programmersought.com/article/45012964151/

if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    app.setAttribute(QtCore.Qt.AA_UseSoftwareOpenGL,True)

    MainUI = YourQMainWindowClass()
    MainUI.showFullScreen()

    sys.exit(app.exec_())