frmdstryr / enamlx

Additional Qt Widgets for Enaml
MIT License
28 stars 9 forks source link

[DOC] How to add live data without reloading them ? #26

Open Kochise opened 2 years ago

Kochise commented 2 years ago

Hi, nice project, I try to add data to a table/tree/plot without changing the existing data yet obviously you have to "reload" the whole model every time.

For instance in enamlx-master\examples\tree_view\tree_view.enaml, when you add a Person using add_person it reloads the model and collapses all the opened nodes, yet the data already present is preserved (checked nodes are still checked). How preventing the tree from collapsing ?

Btw when you delete two Person the example crashes.

As for the plot area, I'd like to add values coming from a probe and have the view to scroll "like an oscilloscope". How is it possible ?

Mostly like https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/rt.gif (the graph on top)

frmdstryr commented 2 years ago

I haven't messed with this in a while but for the TreeView you should be able to use a ContainerList and windowing technique (see the table view example). You might need just create a custom widget.

For the plot the you need to use pyqtgraph's PlotCurveItem and draw with the QPainterPath directly from what I remember.

Kochise commented 2 years ago

I tried to check with https://github.com/inkcut/inkcut/ since it looks like the Live panel seems to do exactly that, but not.

Will see, thank.