get "selected" LinearRegionItem

95 views
Skip to first unread message

alexandra corneyllie

unread,
Oct 21, 2014, 12:55:55 PM10/21/14
to pyqt...@googlegroups.com
Hi,

I'm doing a signal viewver to define manualy signal artifacts (as shown in the picture).

I'm using a pyqtgraph.ViewBox to show and 'replay' the signals. When there is a ctrl + mouse click on the viewbox, the application add a pyqtgraph.LinearRegionItem() :
self.viewBox.clicked.connect(self.handle_click)
with self.handle_clik() is the method that add a new region item (stored on a list)
after checking we have a  pyqtgraph.Qt.QtCore.Qt.ControlModifier.

I would like the user to be able to suppress a selected region item with a keypress on 'suppr'
using a keyPressEvent method overload.

Is there a way to get the current LinearRegionItem (= the one selected by the mouse, not always the last one created) to delete it ?

By the way, is it the correct way to proceed ?

Thanks!
Best
alexandra
artifact_selection.png
Reply all
Reply to author
Forward
0 new messages