Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Performance issue on real-time wave plot into QImage and update() to QWidget

$
0
0
nice to see you guys. I am developing a real-time ECG signal plotting on x86. The brief requirement is to draw the ECG signal as a real-time wave: 1. Draws the 500 HZ ECG signal sample into a backend QImage via QPainter in a sub-thread (in order to async with UI thread so that it will no impact interaction or even impacted by UI interactoin, at each 25 msec (buffered data); 2. After QImage is drawn, call QWidget::update() to notify UI thread, then QWidget (actually the derived QWidget class) simply draws the QImage on it to show the plotted ECG wave data. But, the issue is, the cpu cost is rather high as, nearly 50%. (dual-core i3) I tried to comment out the paintEvent override of the QWidget derived class to not perform the UI thread rendering of QImage, only let the sub-thread to plot the data on QImage silently, and found that the cost is still about 50%. I tried QWindow and QBackingstore in a sub-thread without using QWidget::update(), it works fine, but it is not acceptable because QWindow cause another native window to be created, which breaks my visual effect made by alien QWidget ( or GrahpicsItem). Seems that, the QWidget::update() in a 40HZ rate is the bottleneck? Can any one give me some idea on the rule of QWdiget::udpate() ? Shouldn’t it be used in that high frequency? and, is there any other way to render onto the QWidget surface exception for calling update() ?

Viewing all articles
Browse latest Browse all 18427

Trending Articles