2024-05-13 10:35:21 +08:00
|
|
|
from PyQt6 import QtWidgets, QtGui
|
|
|
|
|
|
|
|
|
2024-06-20 17:08:07 +08:00
|
|
|
class PlotOptionsMenu(QtWidgets.QMenu):
|
2024-05-13 10:35:21 +08:00
|
|
|
def __init__(self, max_samples=1000):
|
|
|
|
super().__init__()
|
|
|
|
self.setTitle("Plot Settings")
|
|
|
|
|
|
|
|
clear = QtGui.QAction("Clear graphs", self)
|
|
|
|
self.addAction(clear)
|
|
|
|
self.clear = clear
|
|
|
|
|
|
|
|
self.samples_spinbox = QtWidgets.QSpinBox()
|
|
|
|
self.samples_spinbox.setRange(2, 100000)
|
|
|
|
self.samples_spinbox.setSuffix(" samples")
|
|
|
|
self.samples_spinbox.setValue(max_samples)
|
|
|
|
|
|
|
|
limit_samples = QtWidgets.QWidgetAction(self)
|
|
|
|
limit_samples.setDefaultWidget(self.samples_spinbox)
|
|
|
|
self.addAction(limit_samples)
|
|
|
|
self.limit_samples = limit_samples
|