Skip to content
Snippets Groups Projects
Commit 7936f21a authored by Alexandros Asonitis's avatar Alexandros Asonitis
Browse files

Long tasks crsuh the software

parent 3ead7308
Branches
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
from matplotlib.figure import Figure
import random
from PyQt6.QtGui import QAction
import time
class MplCanvas(FigureCanvasQTAgg):
def __init__(self,parent = None, width=5, height=4, dpi = 100):
......@@ -199,12 +200,12 @@ class MainWinow(QMainWindow):
for j in range(3):
self.sc.axes[i,j].plot(self.xdata,random.sample(range(50),20))
toolbar = QToolBar("Toolbar")
self.addToolBar(toolbar)
self.toolbar = QToolBar("Toolbar")
self.addToolBar(self.toolbar)
button_action = QAction("start measurement", self)
button_action.triggered.connect(self.toolbar_button_clicked)
toolbar.addAction(button_action)
self.toolbar.addAction(button_action)
self.app_grid.addWidget(self.sc,0,1,3,1)
......@@ -213,6 +214,9 @@ class MainWinow(QMainWindow):
self.showMaximized()
def toolbar_button_clicked(self):
self.widget.setEnabled(False)
self.toolbar.setEnabled(False)
self.xdata = list(range(20))
for i in range(2):
......@@ -221,7 +225,12 @@ class MainWinow(QMainWindow):
self.sc.axes[i,j].plot(self.xdata,random.sample(range(50),20))
# Trigger the canvas to update and redraw.
self.sc.draw()
self.sc.draw_idle()
print("finished")
#self.widget.setEnabled(True)
#self.toolbar.setEnabled(True)
app= QApplication(sys.argv)
w= MainWinow()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment