Public paste
Undefined
By: Guest | Date: Nov 19 2015 19:04 | Format: Python | Expires: never | Size: 596 B | Hits: 774

  1. from PyQt5.QtWidgets import *
  2.  
  3. class MainWindow(QMainWindow):
  4.     def __init__(self):
  5.         super().__init__()
  6.  
  7.         menubar = self.menuBar()
  8.         menubar.addMenu("File")
  9.  
  10.         content = QWidget(self)
  11.         layout = QHBoxLayout()
  12.  
  13.         tabs = QTabWidget()
  14.         tabs.addTab(QPushButton("Click Me #1"), "Button 1")
  15.         tabs.addTab(QPushButton("Click Me #2"), "Button 2")
  16.         layout.addWidget(tabs)
  17.         content.setMinimumSize(200, 200)
  18.  
  19.         content.setLayout(layout)
  20.         self.show()
  21.  
  22. app = QApplication([])
  23. w = MainWindow()
  24. app.exec_()
  25.