diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-10-01 14:53:32 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-10-04 14:13:26 +0000 |
commit | 3709d30a5b3e071a1193d4e2fb534f2d0eed935a (patch) | |
tree | 50217a4e4312d44ec12a0a47414cac1963199eb8 | |
parent | ff92557904b2047d8e53d9d6935881d7b411a6e4 (diff) |
Fix hang in test bug_430.py in Qt 6.3
Terminating the application via closing the last window
only works when the window was actually shown.
Add a call to show() and reformat code.
Task-number: QTBUG-97033
Change-Id: I1e0a82d1baf1676de5a38c1a8fd2408e104b464a
Reviewed-by: Christian Tismer <tismer@stackless.com>
(cherry picked from commit 01b31e518ce4fa82c58db6ae89f481be152eb4dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | sources/pyside6/tests/QtWidgets/bug_430.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sources/pyside6/tests/QtWidgets/bug_430.py b/sources/pyside6/tests/QtWidgets/bug_430.py index b6cf49252..6ce463bc7 100644 --- a/sources/pyside6/tests/QtWidgets/bug_430.py +++ b/sources/pyside6/tests/QtWidgets/bug_430.py @@ -44,9 +44,11 @@ class ListModel(QAbstractListModel): return 0 -app = QApplication([]) -model = ListModel() -v = QListView() -v.setModel(model) -QTimer.singleShot(0, v.close) -app.exec() +if __name__ == '__main__': + app = QApplication([]) + model = ListModel() + v = QListView() + v.setModel(model) + v.show() + QTimer.singleShot(0, v.close) + app.exec() |