Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. class Window(QWidget):
  2. def __init__(self):
  3. super().__init__()
  4.  
  5. def init_gui(self):
  6. self.layout = QVBoxLayout()
  7. self.setLayout(self.layout)
  8.  
  9. self.new1()
  10. self.new2()
  11.  
  12. self.showMaximized()
  13.  
  14. def create_scroll_area(self):
  15. scroll_area = QScrollArea()
  16. widget = QWidget()
  17. scroll_area.setWidget(widget)
  18. layout = QVBoxLayout()
  19. widget.setLayout(layout)
  20. button = QPushButton("Ahoj")
  21. layout.addWidget(button)
  22. self.layout.addLayout(layout)
  23.  
  24. def new1(self):
  25. self.create_scroll_area()
  26.  
  27. def new2(self):
  28. self.create_scroll_area()
  29.  
  30. QLayout::addChildLayout: layout "" already has a parent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement