我想我的对话框是全屏的.我用那个代码:
import sys
from PyQt5.QtWidgets import QApplication, QDialog
app = QApplication(sys.argv)
dialog = QDialog()
dialog.showFullScreen()
app.exec()
但对话保持正常状态.我的平台是Ubuntu 16.04.
解决方法:
感谢@ekhumoro提示,这是一个奇怪的Ubuntu bug.解决方案是:
import sys
from PyQt5.QtWidgets import QApplication, QDialog
from PyQt5.QtCore import Qt
app = QApplication(sys.argv)
dialog = QDialog()
dialog.setWindowFlags(Qt.WindowCloseButtonHint | Qt.WindowType_Mask)
dialog.showFullScreen()
app.exec()