[PySide] QByteArray.fromRawData from bytearray/numpy

Jason H jhihn at gmx.com
Fri Oct 16 21:10:36 CEST 2020


Well I don't know your exact use case but you could use a stream and read the points as they come in (i.e. audio data), or you could write a page and produce a signal or invoke a callback when the write is complete (i.e. image data) 




> Sent: Friday, October 16, 2020 at 1:07 PM
> From: "Tim Roberts" <timr at probo.com>
> To: pyside at qt-project.org
> Subject: Re: [PySide] QByteArray.fromRawData from bytearray/numpy
>
> 許友綸 wrote:
> >
> > hi, QByteArray consturctor can take both bytes and bytearray as its 
> > argument
> > The docs says it makes its own copy. I want a python buffer(numpy) 
> > changing in real-time to be plotted/processed in QML.
> 
> How would Qt know that the data had changed and the plot needed to be 
> regenerated?   Since you need to refresh the plot when the data changes, 
> it's no more trouble to pass in the replacement array.
> 
> -- 
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
> 
> 
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> https://lists.qt-project.org/listinfo/pyside
>


More information about the PySide mailing list