You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using QtDesigner to design a GUI, the construction of the widgets is done in the generated UI class (if pyuic was used), which means that we don't have a chance to specify any constructor arguments if we don't touch that file.
So after looking through the source code a bit, I've found the only way to add a crosshair to a LivePlotWidget after construction is to do something like this:
But this clearly violates encapsulation. Shouldn't there be some way to add a crosshair after construction that would not require calling a privated method?
I believe this was the original motivation behind #13 as well.
The text was updated successfully, but these errors were encountered:
Yes, adding crosshair after LivePlotWidget was constructed was not straightforward.
I've refactor crosshair code a bit. _add_crosshair became add_crosshair. Now you can simply use: widget.add_crosshair(pg.mkPen(color='red', width=1), {'color': 'green'})
I also added method widget.remove_crosshair() to easilly remove crosshair from the plot.
When using QtDesigner to design a GUI, the construction of the widgets is done in the generated UI class (if pyuic was used), which means that we don't have a chance to specify any constructor arguments if we don't touch that file.
So after looking through the source code a bit, I've found the only way to add a crosshair to a LivePlotWidget after construction is to do something like this:
But this clearly violates encapsulation. Shouldn't there be some way to add a crosshair after construction that would not require calling a privated method?
I believe this was the original motivation behind #13 as well.
The text was updated successfully, but these errors were encountered: