QMainWindow QWidget QDialog
addToolBar() centralWidget() setCentralWidget() menuBar() setStatusBar() statusBar().showMessage(message,int timeout=0)
self.button1.clicked.connect(self.onButtonClick) def onButtonClick(self): sender=self.sender() print(sender.text()+"被按下了") qApp=QApplication.instance() qApp.quit()
QWidget.resize(width,height) Qwidget.size() .width() .height() .setFixedHeight(int)/setFixedWidth(int) QWidget.setFixedSize(width,height) .setGeometry(x,y,widht,height) .move(x,y) .pos() 获取X,Y