May 2019
Intermediate to advanced
542 pages
13h 37m
English
Starting with a copy of your Qt application template from Chapter 4, Building Applications with QMainWindow, let's add our main GUI code into the MainWindow.__init__() method:
widget = qtw.QWidget(minimumWidth=600) self.setCentralWidget(widget) widget.setLayout(qtw.QVBoxLayout()) self.url = qtw.QLineEdit() self.table = qtw.QTableWidget(columnCount=2, rowCount=5) self.table.horizontalHeader().setSectionResizeMode( qtw.QHeaderView.Stretch) self.table.setHorizontalHeaderLabels(['key', 'value']) self.fname = qtw.QPushButton( '(No File)', clicked=self.on_file_btn) submit = qtw.QPushButton('Submit Post', clicked=self.submit) response = qtw.QTextEdit(readOnly=True) for w in (self.url, self.table, self.fname, submit, response): ...Read now
Unlock full access