It's a tiny simple code.
In this code, self.showMaximized() is not working.
And even it's so tiny, I don't know why.
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class Window(QWindow):
def __init__(self):
QWindow.__init__(self)
self.setTitle("title")
self.showMaximized()
# self.resize(400,300)
# self.showMaximized()
# self.showFullScreen()
app = QApplication(sys.argv)
screen = Window()
screen.show()
sys.exit(app.exec_())
Delete 'screen.show()', and then showMaximized() worked.
Either you need to use
.showMaximized()only on newly createdObjecti.e.,screen, but not in your constructor or only at the end of your constructor, but not twice.Code: