From 0fa077989d85719aaf17c48b926e9fd1f47c9a8e Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sat, 16 Feb 2019 11:33:48 +0100 Subject: [PATCH] add a debug function to work with pdb --- borg_qt/helper.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/borg_qt/helper.py b/borg_qt/helper.py index 1399d9c..c77ae11 100644 --- a/borg_qt/helper.py +++ b/borg_qt/helper.py @@ -10,6 +10,16 @@ class BorgException(Exception): pass +# This was taken from here: https://stackoverflow.com/a/1745965/7723859 +def debug_trace(): + '''Set a tracepoint in the Python debugger that works with Qt''' + from PyQt5.QtCore import pyqtRemoveInputHook + + from pdb import set_trace + pyqtRemoveInputHook() + set_trace() + + def show_error(e): """Helper function to show an error dialog.""" message = QMessageBox()