How to make PyQt window state to maximised in pyqt

Rao picture Rao · Feb 6, 2013 · Viewed 36.6k times · Source

I am using PyQt4 for GUI in my application.

I want to know how can make my window maximized by default.

I goggled but did not found an alternate.

I tried using below code, but its not for maximized instead it resizes the window to desktop screen size.

But i need the effect which we will see when we press the maximize button wt right side of the window title bar.

screen = QtGui.QDesktopWidget().screenGeometry()
self.setGeometry(0, 0, screen.width(), screen.height())  

Answer

Blender picture Blender · Feb 6, 2013

From the docs:

self.showMaximized()