diff --git a/example.py b/example.py index c6ef5f86..45acb5e3 100644 --- a/example.py +++ b/example.py @@ -1,6 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- import os +import signal from Qt import QtCore, QtGui, QtWidgets @@ -134,6 +135,9 @@ def __init__(self): if __name__ == '__main__': + # handle SIGINT to make the app terminate on CTRL+C + signal.signal(signal.SIGINT, signal.SIG_DFL) + QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) app = QtWidgets.QApplication([]) diff --git a/example_auto_nodes.py b/example_auto_nodes.py index 103abd6e..6e754d79 100644 --- a/example_auto_nodes.py +++ b/example_auto_nodes.py @@ -1,10 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- from NodeGraphQt import NodeGraph, setup_context_menu, \ - QtWidgets, QtCore, PropertiesBinWidget, BackdropNode + PropertiesBinWidget, BackdropNode +from Qt import QtWidgets, QtCore from example_auto_nodes import Publish, RootNode, update_nodes, setup_node_menu import importlib import inspect +import signal import sys import os @@ -47,6 +49,9 @@ def get_published_nodes_from_folder(folder_path): if __name__ == '__main__': + # handle SIGINT to make the app terminate on CTRL+C + signal.signal(signal.SIGINT, signal.SIG_DFL) + QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) app = QtWidgets.QApplication() diff --git a/example_math_nodes.py b/example_math_nodes.py index c25b09fd..3335a23a 100644 --- a/example_math_nodes.py +++ b/example_math_nodes.py @@ -1,5 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +import signal from Qt import QtWidgets, QtCore from NodeGraphQt import (NodeGraph, @@ -11,6 +12,9 @@ from os.path import join if __name__ == '__main__': + # handle SIGINT to make the app terminate on CTRL+C + signal.signal(signal.SIGINT, signal.SIG_DFL) + QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) app = QtWidgets.QApplication([])