How to add a tab to QTabWidget using the button on the form?
问题 I decided to write a visual form for my script. The idea is to have a button that will add new tabs to QTabWidget. It does not work and I can not find a good example. I use PyQt5. Here's a piece of what I've tried: import sys from PyQt5.QtGui import QIcon from PyQt5 import QtCore, QtWidgets class mainForm(QtWidgets.QWidget): def __init__(self): super().__init__() self.runUi() def runUi(self): self.resize(250, 150) self.move(300, 300) self.setWindowTitle('Let\'s Rock!') self.setWindowIcon