2

Everytime you create new project from Qt Creator there is on top QWidget which you can delete.

enter image description here

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?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Erik Šťastný
  • 1,487
  • 1
  • 15
  • 41

1 Answers1

3

When you create a GUI with Qt Designer you can choose the widget that you take as base as shown in the following image:

enter image description here

Generally we choose from the first option templates/forms, but we can also choose from Widgets (Second option)

enter image description here

In this second option we can choose as a basis for QTabWidget.

enter image description here

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • Ahh i am so blind. I have never think that "Widgets" option can be scroll out and i always use options from templates. In my version of Qt Designer it is not so visible as it in your version. – Erik Šťastný Jul 25 '17 at 08:00
  • Open Qt Designer directly, do not use it through Qt Creator. – eyllanesc Jul 25 '17 at 08:02