Skip to content

Commit f82c581

Browse files
committed
add error message signal
1 parent c5fda15 commit f82c581

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
QPushButton,
1414
QMessageBox,
1515
)
16+
from PySide2.QtCore import Signal
1617
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
1718

1819
# Suppress font warnings
@@ -27,6 +28,8 @@ class FunctionPlotter(QMainWindow):
2728
using PySide2 for the GUI and Matplotlib for plotting.
2829
"""
2930

31+
error_message_signal = Signal(str)
32+
3033
def __init__(self):
3134
super().__init__()
3235
self.setWindowTitle("Function Plotter")
@@ -165,6 +168,7 @@ def show_error_message(self, message):
165168
- message (str): The error message to display.
166169
"""
167170
QMessageBox.critical(self, "Error", message)
171+
self.error_message_signal.emit(message)
168172

169173

170174
if __name__ == "__main__":

0 commit comments

Comments
 (0)