python 2.7 - How to maximize QWidget at startup -
How to start a widget in fullscreen by default? Tried to add the set windstate but failed.
Here is the code:
class main (QtGui.QWidget): def __init __ (self): QtGui.QWidget .__ init __ (self) Self.ui = Ui_Form () self.ui.setupUi (self) self.ui.setWindowState (QtCore.Qt.WindowMaximized) #error: 'Ui_Form' object has no attribute 'setWindowState' self.ui.btn1.clicked.connect (self. btn1_clicked) self.ui.btn2.clicked.connect (self.btn2_clicked) def btn1_clicked (self): global value 1 value 1 + = 1 self.ui.num1.setText ( "% d"% value1) def Bitian 2_sked (self ): Global value 2 value 2 + = 1 self. 2.Set Text ("% d"% value2)
to maximize the window For parents use the QWidget :: showMaximized () widget.
Comments
Post a Comment