我使用qsplashsscreen免费获得一些想要的行为:图像显示,居中,容易无框。你知道吗
问题是,对于我的用例,我不希望单击图像来关闭屏幕。你知道吗
我已经尝试过重写eventFilter,正如许多关于这个行为的c++文章所建议的那样,但是在PySide 2.x.x/Qt5中,从来没有调用过这个方法。你知道吗
class MySplashScreen(QtWidgets.QSplashScreen):
def __init__(self, my_pixmap):
super(MySplashScreen, self).
__init__(my_pixmap, QtCore.Qt.FramelessWindowHint)
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint |
QtCore.Qt.FramelessWindowHint)
def eventFilter(self, object, event):
print("never called")
我还缺什么简单的东西吗?你知道吗
出于我的目的,我所要做的就是重写mousePressEvent()并传递。你知道吗
这阻止了点击取消屏幕,但不影响我在初始屏幕上方布局的UI元素上的鼠标事件,所以它勾选了我的所有框。你知道吗
相关问题 更多 >
编程相关推荐