Everytime you create new project from Qt Creator there is on top QWidget which you can delete.
You can of course write the code manually as this:
app = QApplication(sys.argv)
ex = Main()
sys.exit(app.exec_())
where Main class is inherited from QTabWidget and everything works.
class Main(QTabWidget):
def __init__(self):
super().__init__()
Is there any way how to achieve this from Qt Designer? How can i delete QWidget and put QTabWidget on top of hierarchy?
When you create a GUI with Qt Designer you can choose the widget that you take as base as shown in the following image:
Generally we choose from the first option templates/forms
, but we can also choose from Widgets
(Second option)
In this second option we can choose as a basis for QTabWidget
.