Python Forum
Application becomes unresponsive as soon as i use the buttons
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Application becomes unresponsive as soon as i use the buttons
#3
This is a short example that demonstrates the problem.
import sys
from PySide6.QtWidgets import QApplication, QVBoxLayout, QScrollArea, QWidget


class CategoryWindow(QWidget):
    def __init__(self, parent=None):
        super().__init__(parent)
        layout = QVBoxLayout(self)
        scroll_area = QScrollArea()
        scroll_contents = QWidget(scroll_area)
        scroll_contents.setLayout(layout)
        scroll_area.setWidget(scroll_contents)
        layout.addWidget(scroll_area)


if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = CategoryWindow()
    window.show()
    sys.exit(app.exec())
And here is the same code with a tiny change that results in the window being drawn.
import sys
from PySide6.QtWidgets import QApplication, QVBoxLayout, QScrollArea, QWidget


class CategoryWindow(QWidget):
    def __init__(self, parent=None):
        super().__init__(parent)
        layout = QVBoxLayout(self)
        scroll_area = QScrollArea()
        scroll_contents = QWidget(scroll_area)
        # scroll_contents.setLayout(layout)
        scroll_area.setWidget(scroll_contents)
        layout.addWidget(scroll_area)


if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = CategoryWindow()
    window.show()
    sys.exit(app.exec())
Reply


Messages In This Thread
RE: Application becomes unresponsive as soon as i use the buttons - by deanhystad - May-26-2023, 03:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] program unresponsive during pynput mouse click RobotTech 1 3,549 May-07-2020, 04:43 PM
Last Post: RobotTech
  [Tkinter] Window unresponsive when executed. fawazcode 2 3,848 Sep-11-2017, 12:29 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020