diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-27 15:29:58 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-27 15:30:00 +0200 |
commit | 48fad87c14e6e09e01a66b7b1c4b62778a2268b1 (patch) | |
tree | 6a4f55c9b63169646548ad2f09e21dcf9ede7450 | |
parent | b1c4e828894d2a1106ff1d3ca5fc7d0853301b59 (diff) | |
parent | 9d4fd1b6526911e2836e84e45f67315968b1a117 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.9
Change-Id: Id001f5c242e2a296c370f7a33f329d74fdfe5963
-rw-r--r-- | sources/pyside2/tests/QtWidgets/bug_728.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sources/pyside2/tests/QtWidgets/bug_728.py b/sources/pyside2/tests/QtWidgets/bug_728.py index 8ef40b374..d2783b746 100644 --- a/sources/pyside2/tests/QtWidgets/bug_728.py +++ b/sources/pyside2/tests/QtWidgets/bug_728.py @@ -29,8 +29,23 @@ from PySide2.QtWidgets import * from PySide2.QtCore import * +# Periodically check for the file dialog to appear and close it +dialog = None +def timerHandler(): + global dialog + if dialog is not None: + dialog.reject() + else: + for widget in QApplication.topLevelWidgets(): + if isinstance(widget, QDialog) and widget.isVisible(): + dialog = widget + app = QApplication([]) -QTimer.singleShot(200, app.quit) +QTimer.singleShot(30000, app.quit) # emergency +timer = QTimer() +timer.setInterval(50) +timer.timeout.connect(timerHandler) +timer.start() # This test for a dead lock in QFileDialog.getOpenFileNames, the test fail with a timeout if the dead lock exists. QFileDialog.getOpenFileNames(None, "caption", QDir.homePath(), None, "", QFileDialog.DontUseNativeDialog) |